lib/critic/callbacks.rb in critic-0.2.2 vs lib/critic/callbacks.rb in critic-0.2.3
- old
+ new
@@ -64,11 +64,15 @@
def _normalize_callback_option(options, from, to) # :nodoc:
from = options[from]
return unless from
- from = Array(from).map { |o| "authorization.action.to_s == '#{o}'" }
- options[to] = Array(options[to]).unshift(from).join(' || ')
+ actions = Array(options[to]) + Array(from)
+ options[to] = lambda {
+ actions.any? { |action|
+ authorization.action.to_s == action.to_s
+ }
+ }
end
# Skip before, after, and around action callbacks matching any of the names.
#
# ==== Parameters