Class: ActionController::Base
- Inherits:
-
Object
- Object
- ActionController::Base
- Defined in:
- lib/generators/cant_cant_cant/install/templates/initializer.rb
Instance Method Summary collapse
-
#current_roles ⇒ Object
Write your own method to return the roles for current user.
Instance Method Details
#current_roles ⇒ Object
Write your own method to return the roles for current user
35 36 37 38 39 40 |
# File 'lib/generators/cant_cant_cant/install/templates/initializer.rb', line 35 def current_roles return [] unless defined? current_user return [] if current_user.empty? current_user.roles end |