lib/.rbnext/3.0/action_policy/policy/reasons.rb in action_policy-0.7.2 vs lib/.rbnext/3.0/action_policy/policy/reasons.rb in action_policy-0.7.3
- old
+ new
@@ -199,16 +199,15 @@
def allowed_to?(rule, record = :__undef__, inline_reasons: false, **options)
res =
if (record == :__undef__ || record == self.record) && options.empty?
rule = resolve_rule(rule)
policy = self
- with_clean_result { apply(rule) }
+ apply_r(rule)
else
policy = policy_for(record: record, **options)
rule = policy.resolve_rule(rule)
- policy.apply(rule)
- policy.result
+ policy.apply_r(rule)
end
if res.fail? && result&.reasons
inline_reasons ? result.reasons.merge(res.reasons) : result.reasons.add(policy, rule, res.details)
end