Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Encapsulate the logic in one place
- def privileged_users
- return false unless (RAILS_ENV.eql?('development') || current_user.admin? || current_user.vp? || current_user.supervisor?)
- returning(true) do
- yield if block_given?
- end
- end
- # Ahhh, cleaner :)
Add Comment
Please, Sign In to add comment