diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-20 00:32:14 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-20 00:32:14 -0700 |
commit | 5d84c732ee06f58732167b74ae51d94ca216df12 (patch) | |
tree | ca79cda1cad25f6795c45eae14d212ab14e73fd4 /activesupport/lib | |
parent | a22a778f860032b9d6bf3a8b19d0b22fc174550c (diff) | |
download | rails-5d84c732ee06f58732167b74ae51d94ca216df12.tar.gz rails-5d84c732ee06f58732167b74ae51d94ca216df12.tar.bz2 rails-5d84c732ee06f58732167b74ae51d94ca216df12.zip |
Treating strings as enumerable is deprecated
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/new_callbacks.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb index 2ac5339f07..356d70b650 100644 --- a/activesupport/lib/active_support/new_callbacks.rb +++ b/activesupport/lib/active_support/new_callbacks.rb @@ -116,12 +116,12 @@ module ActiveSupport end def normalize_options!(options) - options[:if] = Array(options[:if]) - options[:unless] = Array(options[:unless]) + options[:if] = Array.wrap(options[:if]) + options[:unless] = Array.wrap(options[:unless]) options[:per_key] ||= {} - options[:per_key][:if] = Array(options[:per_key][:if]) - options[:per_key][:unless] = Array(options[:per_key][:unless]) + options[:per_key][:if] = Array.wrap(options[:per_key][:if]) + options[:per_key][:unless] = Array.wrap(options[:per_key][:unless]) end def next_id @@ -246,11 +246,11 @@ module ActiveSupport conditions = [] unless options[:if].empty? - conditions << Array(_compile_filter(options[:if])) + conditions << Array.wrap(_compile_filter(options[:if])) end unless options[:unless].empty? - conditions << Array(_compile_filter(options[:unless])).map {|f| "!#{f}"} + conditions << Array.wrap(_compile_filter(options[:unless])).map {|f| "!#{f}"} end ["if #{conditions.flatten.join(" && ")}", "end"] |