diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-11-09 10:57:20 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-11-09 10:57:20 -0800 |
commit | 790c062280c0d23c2033e4983c13d402c0424f2a (patch) | |
tree | 7b652b420411779072c2371a42e84c83525f63b1 /activesupport/lib/active_support/deprecated_callbacks.rb | |
parent | 51fe6d05e73a4e0f8481f4e441f4ca886d65a69c (diff) | |
parent | 303991288633effea5a1d1774dbd861951303fe5 (diff) | |
download | rails-790c062280c0d23c2033e4983c13d402c0424f2a.tar.gz rails-790c062280c0d23c2033e4983c13d402c0424f2a.tar.bz2 rails-790c062280c0d23c2033e4983c13d402c0424f2a.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/lib/active_support/deprecated_callbacks.rb')
-rw-r--r-- | activesupport/lib/active_support/deprecated_callbacks.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecated_callbacks.rb b/activesupport/lib/active_support/deprecated_callbacks.rb index 20fb03cbeb..f56fef0b6d 100644 --- a/activesupport/lib/active_support/deprecated_callbacks.rb +++ b/activesupport/lib/active_support/deprecated_callbacks.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/array/extract_options' +require 'active_support/core_ext/array/wrap' module ActiveSupport # Callbacks are hooks into the lifecycle of an object that allow you to trigger logic @@ -194,8 +195,8 @@ module ActiveSupport end def should_run_callback?(*args) - [options[:if]].flatten.compact.all? { |a| evaluate_method(a, *args) } && - ![options[:unless]].flatten.compact.any? { |a| evaluate_method(a, *args) } + Array.wrap(options[:if]).flatten.compact.all? { |a| evaluate_method(a, *args) } && + !Array.wrap(options[:unless]).flatten.compact.any? { |a| evaluate_method(a, *args) } end end |