Class: DoRole::Role

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
PermissionManageable
Defined in:
lib/do_role/role.rb

Class Method Summary collapse

Methods included from PermissionManageable

#add_permission, #all_permissions, #cached_permissions, #computed_permissions, #has_permission?, #remove_permission

Class Method Details

.define_role_association(association_name, options = {}) ⇒ Object



14
15
16
17
# File 'lib/do_role/role.rb', line 14

def self.define_role_association(association_name, options = {})
  has_many association_name, options.merge(dependent: :destroy)
  has_many options[:through_model].to_s.pluralize.to_sym, through: association_name if options[:through_model]
end