Skip to content
Browse files

try is shorter

  • Loading branch information...
1 parent 3a570bf commit 209b3cf74cc3b54906df1261347cfabd54b0bb30 @corny corny committed Mar 18, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 app/controllers/application_controller.rb
View
5 app/controllers/application_controller.rb
@@ -14,12 +14,11 @@ def development_or_test_mode?
end
def is_admin
- return false unless current_user
- current_user.admin
+ current_user.try(:admin)
end
def banned?
- if current_user.present? && current_user.banned?
+ if current_user.try(:banned?)
sign_out current_user
flash[:error] = "Dieser Benutzer wurde blockiert, bitte kontaktieren sie den Administrator"
root_path

0 comments on commit 209b3cf

Please sign in to comment.
Something went wrong with that request. Please try again.