Class: User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- User
- Defined in:
- lib/generators/esp_auth/install/templates/app/models/user.rb
Instance Method Summary collapse
Instance Method Details
#contexts ⇒ Object
27 28 29 |
# File 'lib/generators/esp_auth/install/templates/app/models/user.rb', line 27 def contexts .map(&:context).uniq end |
#contexts_tree ⇒ Object
31 32 33 34 35 36 |
# File 'lib/generators/esp_auth/install/templates/app/models/user.rb', line 31 def contexts_tree contexts.flat_map{|c| c.respond_to?(:subtree) ? c.subtree : c} .uniq .flat_map{|c| c.respond_to?(:subcontexts) ? [c] + c.subcontexts : c } .uniq end |