-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with method check? in the policy #113
Comments
Thanks for the reproduction! I'll take a look and come back with a fix. |
Fixed in master. Just a reminder, that this is not a designed way of calling policy rules. You should use |
Thank you! |
@palkan 😕 what if you want to account for To get around this issue without the fix in master I've been writing |
Tell us about your environment
Ruby Version: 2.7.1p83
Framework Version (Rails, whatever): Rails 6.0.2.2
Action Policy Version: action_policy (0.4.3)
Reproduction Script: https://github.com/delavaler/script/blob/master/check_bug.rb
What did you do?
@palkan Hi
I want to check in the policy the rule from another policy, using this instruction https://actionpolicy.evilmartians.io/#/writing_policies?id=calling-other-policies
When
check?
should return true it works fineWhen
check?
should return false I get error<NoMethodError: undefined method
reasons' for nil:NilClass>`in the 192 line
gems/ruby-2.7.1/gems/action_policy-0.4.3/lib/action_policy/policy/reasons.rb:189 ActionPolicy::Policy::Reasons#allowed_to?:
The text was updated successfully, but these errors were encountered: