Guest User

Untitled

a guest
Feb 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # Encapsulate the logic in one place
  2. def privileged_users
  3. return false unless (RAILS_ENV.eql?('development') || current_user.admin? || current_user.vp? || current_user.supervisor?)
  4. returning(true) do
  5. yield if block_given?
  6. end
  7. end
  8.  
  9. # Ahhh, cleaner :)
Add Comment
Please, Sign In to add comment