Module: RoleStrategy::DataMapper::OneRole

Extended by:
Roles::Generic::User::Configuration
Defined in:
lib/roles_data_mapper/strategy/single/one_role.rb

Defined Under Namespace

Modules: ClassMethods, Implementation

Class Method Summary collapse

Class Method Details

.default_role_attributeObject



14
15
16
# File 'lib/roles_data_mapper/strategy/single/one_role.rb', line 14

def self.default_role_attribute
  :one_role
end

.included(base) ⇒ Object



18
19
20
21
22
23
# File 'lib/roles_data_mapper/strategy/single/one_role.rb', line 18

def self.included base
  base.extend Roles::Generic::Role::ClassMethods
  base.extend ClassMethods
  # base.instance_eval "has 1, :one_role, 'Role'" # , :parent_key => [role_id], :child_key => [:id]  
  base.instance_eval "belongs_to :one_role, :class_name => 'Role'" # :foreign_key => :role_id
end