diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-10 22:19:38 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-10 22:37:36 -0700 |
commit | 86dda361e2363e27d39cc66d490335d9c7126c7b (patch) | |
tree | 0eac0be11b5ad9137d4e5647b21dfd3bf4036151 /activerecord/lib/active_record/associations | |
parent | 61355c0e243c4b6d9324479c96ef31e922f0355b (diff) | |
download | rails-86dda361e2363e27d39cc66d490335d9c7126c7b.tar.gz rails-86dda361e2363e27d39cc66d490335d9c7126c7b.tar.bz2 rails-86dda361e2363e27d39cc66d490335d9c7126c7b.zip |
Avoid deprecated String#to_a by using Array.wrap(...) instead of Array(...)
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/association_proxy.rb | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index b808f8c306..6a4cef0d50 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -1,4 +1,5 @@ require 'set' +require 'active_support/core_ext/array/wrap' module ActiveRecord module Associations @@ -98,7 +99,7 @@ module ActiveRecord if @target.is_a?(Array) @target.to_ary else - Array(@target) + Array.wrap(@target) end end alias_method :to_a, :to_ary diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index 4fb1df3ab9..b9d0fe3abe 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/array/wrap' + module ActiveRecord module Associations # This is the root class of all association proxies: @@ -55,7 +57,7 @@ module ActiveRecord @owner, @reflection = owner, reflection @updated = false reflection.check_validity! - Array(reflection.options[:extend]).each { |ext| proxy_extend(ext) } + Array.wrap(reflection.options[:extend]).each { |ext| proxy_extend(ext) } reset end |