Commit fe59d343

mo khan <mo@mokhan.ca>
2013-12-31 18:06:47
when checking if they are an admin use try so that if they are not logged in it doesn't create an error.
1 parent 245652a
Changed files (1)
app
controllers
app/controllers/admin/admin_controller.rb
@@ -6,7 +6,7 @@ module Admin
     private
 
     def restrict_access!
-      redirect_to root_path unless current_user.is_admin?
+      redirect_to root_path unless current_user.try(:is_admin?)
     end
   end
 end