Module: Strongbolt::UserAbilities
- Defined in:
- lib/strongbolt/user_abilities.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
-
.included(receiver) ⇒ Object
End InstanceMethods.
Class Method Details
.included(receiver) ⇒ Object
End InstanceMethods
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/strongbolt/user_abilities.rb', line 267 def self.included(receiver) receiver.extend ClassMethods receiver.send :include, InstanceMethods receiver.class_eval do has_many :user_groups_users, class_name: 'Strongbolt::UserGroupsUser', dependent: :delete_all, inverse_of: :user, foreign_key: :user_id has_many :user_groups, through: :user_groups_users has_many :roles, through: :user_groups end # Sets up user association Strongbolt.tenants.each do |tenant| tenant.send :setup_association_on_user end end |