Module: Roles::Base

Defined in:
lib/roles_data_mapper/role.rb,
lib/roles_data_mapper/base.rb

Instance Method Summary collapse

Instance Method Details

#valid_roles_are(*role_list) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/roles_data_mapper/role.rb', line 2

def valid_roles_are(*role_list)
  strategy_class.valid_roles = role_list.to_symbols
  if role_class_name
    role_list.each do |name|
      begin
        role = role_class_name.create(:name => name.to_s)
        role.save
      rescue
      end
    end
  end
end