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

Change @policy instance variable to @_policy.

This commit is contained in:
Dylan Fogarty-MacDonald 2014-05-19 15:05:09 +10:00 committed by Jonas Nicklas and Kim Burgestrand
parent 617b401a8c
commit 19cbaa7318

View file

@ -83,9 +83,12 @@ module Pundit
attr_writer :policy_scope
def policy(record)
@policy or Pundit.policy!(pundit_user, record, self.class.parent)
@_policy or Pundit.policy!(pundit_user, record, self.class.parent)
end
def policy=(policy)
@_policy = policy
end
attr_writer :policy
def pundit_user
current_user