From 19cbaa73182166525559962d908566f30a0d00a9 Mon Sep 17 00:00:00 2001 From: Dylan Fogarty-MacDonald Date: Mon, 19 May 2014 15:05:09 +1000 Subject: [PATCH] Change @policy instance variable to @_policy. --- lib/pundit.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pundit.rb b/lib/pundit.rb index fd7127e..a147417 100644 --- a/lib/pundit.rb +++ b/lib/pundit.rb @@ -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