From fb835fc1e2d915deed2a1a7bd6d2e14d526897df Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 20 Oct 2010 15:46:04 -0700 Subject: use zip + Hash.[] rather than looping with an index --- activerecord/lib/active_record/base.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index dd50e1658a..315598fc4b 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -988,9 +988,7 @@ module ActiveRecord #:nodoc: end def construct_attributes_from_arguments(attribute_names, arguments) - attributes = {} - attribute_names.each_with_index { |name, idx| attributes[name] = arguments[idx] } - attributes + Hash[attribute_names.zip(arguments)] end # Similar in purpose to +expand_hash_conditions_for_aggregates+. -- cgit v1.2.3