Merge pull request #982 from jd-erreape/add_scopes_to_roleable

Added role scopes to roleable
This commit is contained in:
Robin Ward
2013-06-07 12:08:26 -07:00
2 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,12 @@ require 'active_support/concern'
module Roleable
extend ActiveSupport::Concern
included do
scope :admins, -> { where(admin: true) }
scope :moderators, -> { where(moderator: true) }
scope :staff, -> { where("moderator or admin ") }
end
# any user that is either a moderator or an admin
def staff?
admin || moderator