Created
February 17, 2017 08:39
-
-
Save simonlehmann/47501cdea4c5119730405e81525b47f6 to your computer and use it in GitHub Desktop.
Loading all users with one of many Rolify roles per scoped resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class Forum < ActiveRecord::Base | |
belongs_to :user | |
def collaborators | |
User.with_any_role({ name: :admin, resource: self }, { name: :moderator, resource: self }) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment