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.20.3 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.20.2 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.20.1 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.20.0 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.7 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.6 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.5 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.4 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.3 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.2 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.1 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.19.0 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.18.2 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.18.1 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.18.0 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.17.7 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.17.6 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.17.5 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.17.4 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb
six-updater-web-0.17.3 lib/six-updater-web/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb