Module: RoleStrategy::ActiveRecord::ManyRoles::ClassMethods

Defined in:
lib/roles_active_record/strategy/multi/many_roles.rb

Instance Method Summary collapse

Instance Method Details

#in_any_role(*role_names) ⇒ Object



19
20
21
# File 'lib/roles_active_record/strategy/multi/many_roles.rb', line 19

def in_any_role(*role_names)
  joins(:many_roles).where(role_arel_table[:name].in(role_names.flatten.to_strings))
end

#in_role(role_name) ⇒ Object



15
16
17
# File 'lib/roles_active_record/strategy/multi/many_roles.rb', line 15

def in_role(role_name)
  in_any_role(role_name)
end