1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Add Scope class to generator

This commit is contained in:
Andrey Deryabin 2014-03-05 01:30:45 +04:00
parent baf681a341
commit d3bf3141b1

View file

@ -37,5 +37,18 @@ class ApplicationPolicy
def scope
Pundit.policy_scope!(user, record.class)
end
class Scope
attr_reader :user, :scope
def initialize(user, scope)
@user = user
@scope = scope
end
def resolve
scope
end
end
end