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:
parent
617b401a8c
commit
19cbaa7318
1 changed files with 5 additions and 2 deletions
|
@ -83,9 +83,12 @@ module Pundit
|
||||||
attr_writer :policy_scope
|
attr_writer :policy_scope
|
||||||
|
|
||||||
def policy(record)
|
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
|
end
|
||||||
attr_writer :policy
|
|
||||||
|
|
||||||
def pundit_user
|
def pundit_user
|
||||||
current_user
|
current_user
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue