Module: RoleStrategy::DataMapper::ManyRoles

Extended by:
Roles::Generic::User::Configuration
Defined in:
lib/roles_data_mapper/strategy/multi/many_roles.rb

Defined Under Namespace

Modules: ClassMethods, Implementation

Class Method Summary collapse

Class Method Details

.default_role_attributeObject



20
21
22
# File 'lib/roles_data_mapper/strategy/multi/many_roles.rb', line 20

def self.default_role_attribute
  :many_roles
end

.included(base) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/roles_data_mapper/strategy/multi/many_roles.rb', line 24

def self.included base
  base.extend Roles::Generic::Role::ClassMethods
  base.extend ClassMethods
  base.instance_eval %{ 
    has n, :user_roles
    has n, :many_roles, 'Role', :through => :user_roles, :via => :role
  }      
end