Permalink
Browse files

Treating strings as enumerable is deprecated

  • Loading branch information...
1 parent a22a778 commit 5d84c732ee06f58732167b74ae51d94ca216df12 @jeremy jeremy committed Apr 20, 2009
Showing with 6 additions and 6 deletions.
  1. +6 −6 activesupport/lib/active_support/new_callbacks.rb
@@ -116,12 +116,12 @@ def clone(klass)
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 @@ def _compile_options(options)
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"]

0 comments on commit 5d84c73

Please sign in to comment.