Created
February 17, 2017 11:22
-
-
Save pedrosmmoreira/767fedf92e4db9c9f382c91a328c315b to your computer and use it in GitHub Desktop.
This file contains 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 PolicyContext | |
attr_reader :record | |
def initialize(record, user) | |
@record = record | |
@user = user | |
end | |
def policy_class | |
"#{@user.role}FooPolicy".classify | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment