Sha256: 8ccf9290403293cfb36008c8b4343933f6e6625056aa35c844bfdd8e03a7b3e4

Contents?: true

Size: 450 Bytes

Versions: 97

Compression:

Stored size: 450 Bytes

Contents

module Goldberg
  class RolesPermission < ActiveRecord::Base
    include Goldberg::Model

    validates_presence_of :role_id, :permission_id
    
    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
    
  end
end

Version data entries

97 entries across 97 versions & 2 rubygems

Version Path
six-updater-web-0.24.15 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.23.5 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.23.4 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb