Class: Goldberg::RolesPermission

Inherits:
ActiveRecord::Base show all
Includes:
Model
Defined in:
lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb

Class Method Summary collapse

Methods included from Model

included

Methods inherited from ActiveRecord::Base

#associated_valid?, #no_errors_in_associated?, #save_associated, #save_associated!, #save_with_unsaved_flag, #to_label, #unsaved=, #unsaved?

Class Method Details

.find_for_role(role_ids) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb', line 7

def RolesPermission.find_for_role(role_ids)
  querystr = <<-END
select rp.*, p.name 
from #{prefix}roles_permissions rp inner join #{prefix}permissions p 
  on rp.permission_id = p.id 
where role_id in (?) order by p.name
END
  return find_by_sql([querystr, role_ids])
end