diff options
| author | mo khan <mo@mokhan.ca> | 2013-12-31 11:06:47 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-12-31 11:06:47 -0700 |
| commit | fe59d343bf900c89af9f2140be50a7de8e3e5e5a (patch) | |
| tree | 38c2f5fc70b417936d4c1406909fa044d80fbcae /app/controllers/admin/admin_controller.rb | |
| parent | 245652a8b5dc6b060db5a5696a2a882ec79e7dec (diff) | |
when checking if they are an admin use try so that if they are not logged in it doesn't create an error.
Diffstat (limited to 'app/controllers/admin/admin_controller.rb')
| -rw-r--r-- | app/controllers/admin/admin_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/admin/admin_controller.rb b/app/controllers/admin/admin_controller.rb index b2d5558c..a332eae0 100644 --- a/app/controllers/admin/admin_controller.rb +++ b/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 |
