lib/action_policy/behaviour.rb in action_policy-0.6.2 vs lib/action_policy/behaviour.rb in action_policy-0.6.3

- old
+ new

@@ -59,11 +59,11 @@ def authorization_context @_authorization_context ||= build_authorization_context end - def build_authorization_context + private def build_authorization_context self.class.authorization_targets .each_with_object({}) do |(key, meth), obj| obj[key] = send(meth) end end @@ -73,10 +73,10 @@ def authorization_rule_for(policy, rule) policy.resolve_rule(rule) end def lookup_authorization_policy(record, with: nil, **options) # :nodoc: - if record == :__undef__ + if :__undef__ == record # rubocop:disable Style/YodaCondition record = if with implicit_authorization_target else implicit_authorization_target!