Module: RoleStrategy::MongoMapper::ManyRoles

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

Defined Under Namespace

Modules: ClassMethods, Implementation

Class Method Summary collapse

Class Method Details

.default_role_attributeObject



5
6
7
# File 'lib/roles_mongo_mapper/strategy/multi/many_roles.rb', line 5

def self.default_role_attribute
  :many_roles
end

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/roles_mongo_mapper/strategy/multi/many_roles.rb', line 9

def self.included base
  base.extend Roles::Generic::Role::ClassMethods
  base.extend ClassMethods
  
  # TODO - refactor into strategy method in base.rb 
  # base.key :many_roles_ids, Array, :typecast => 'ObjectId'
  # base.many :many_roles, :class_name => 'Role', :in => :many_roles_ids 
  # base.ensure_index :many_role_ids     
end