no use for set, no need to to_ary, reduce extra objects

This commit is contained in:
Aaron Patterson
2010-12-20 14:40:07 -08:00
parent 6e14feb978
commit 3ce3c21997

View File

@@ -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