diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-20 14:40:07 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-20 14:40:07 -0800 |
commit | 3ce3c21997c92cee4123e76d75e39fcfe3d1e209 (patch) | |
tree | acdb5597f2955f804de7c6288f950cbe732cbbeb /activerecord/lib/active_record/associations | |
parent | 6e14feb978434802e7a46b26d99d64e31f545fe2 (diff) | |
download | rails-3ce3c21997c92cee4123e76d75e39fcfe3d1e209.tar.gz rails-3ce3c21997c92cee4123e76d75e39fcfe3d1e209.tar.bz2 rails-3ce3c21997c92cee4123e76d75e39fcfe3d1e209.zip |
no use for set, no need to to_ary, reduce extra objects
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 1c8541be67..c513e8ab08 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -1,4 +1,3 @@ -require 'set' require 'active_support/core_ext/array/wrap' module ActiveRecord @@ -75,7 +74,7 @@ module ActiveRecord find(:first, *args) else load_target unless loaded? - args = args[1..-1] if args.first.kind_of?(Hash) && args.first.empty? + args.shift if args.first.kind_of?(Hash) && args.first.empty? @target.first(*args) end end @@ -93,7 +92,7 @@ module ActiveRecord def to_ary load_target if @target.is_a?(Array) - @target.to_ary + @target else Array.wrap(@target) end |