File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def with_clean_result # :nodoc:
101101 #
102102 # If record is `nil` then we uses the current policy.
103103 def allowed_to? ( rule , record = :__undef__ , **options )
104- if record == :__undef__ && options . empty?
104+ if ( record == :__undef__ || record == self . record ) && options . empty?
105105 __apply__ ( rule )
106106 else
107107 policy_for ( record : record , **options ) . apply ( rule )
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ def details
179179
180180 def allowed_to? ( rule , record = :__undef__ , **options )
181181 res =
182- if record == :__undef__
182+ if ( record == :__undef__ || record == self . record ) && options . empty?
183183 policy = self
184184 with_clean_result { apply ( rule ) }
185185 else
You can’t perform that action at this time.
0 commit comments