diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-02-27 19:37:09 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-02-27 19:37:09 -0800 |
commit | 9510070f7859d00b1e47b62c1e06dbf21fca1b9b (patch) | |
tree | feaed42ceefdf573fced4d24a14de98863d82770 | |
parent | c16c7a8de4e543a92de10a138bdd7caa5ac902d7 (diff) | |
download | rails-9510070f7859d00b1e47b62c1e06dbf21fca1b9b.tar.gz rails-9510070f7859d00b1e47b62c1e06dbf21fca1b9b.tar.bz2 rails-9510070f7859d00b1e47b62c1e06dbf21fca1b9b.zip |
Fixes multiple conditions
-rw-r--r-- | actionpack/lib/action_controller/abstract/callbacks.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/new_callbacks.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/abstract/callbacks.rb b/actionpack/lib/action_controller/abstract/callbacks.rb index 0add363552..a88d4c1567 100644 --- a/actionpack/lib/action_controller/abstract/callbacks.rb +++ b/actionpack/lib/action_controller/abstract/callbacks.rb @@ -17,11 +17,11 @@ module AbstractController module ClassMethods def _normalize_callback_options(options) if only = options[:only] - only = Array(only).map {|o| "action_name == :#{o}"}.join(" && ") + only = Array(only).map {|o| "action_name == :#{o}"}.join(" || ") options[:per_key] = {:if => only} end if except = options[:except] - except = Array(except).map {|e| "action_name == :#{e}"}.join(" && ") + except = Array(except).map {|e| "action_name == :#{e}"}.join(" || ") options[:per_key] = {:unless => except} end end diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb index cf717bfbb9..5f1afc9b3c 100644 --- a/activesupport/lib/active_support/new_callbacks.rb +++ b/activesupport/lib/active_support/new_callbacks.rb @@ -349,7 +349,7 @@ module ActiveSupport # The _run_save_callbacks method can optionally take a key, which # will be used to compile an optimized callback method for each # key. See #define_callbacks for more information. - def _define_runner(symbol, str, options) + def _define_runner(symbol, str, options) str = <<-RUBY_EVAL def _run_#{symbol}_callbacks(key = nil) if key @@ -373,7 +373,7 @@ module ActiveSupport @_keyed_callbacks ||= {} @_keyed_callbacks[[kind, key]] ||= begin str = self.send("_#{kind}_callbacks").compile(key, :object => obj, :terminator => self.send("_#{kind}_terminator")) - + self.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def _run__#{klass.split("::").last}__#{kind}__#{key}__callbacks #{str} |