提交 fb835fc1 编写于 作者: A Aaron Patterson

use zip + Hash.[] rather than looping with an index

上级 954bd126
......@@ -988,9 +988,7 @@ def self.#{method_id}(*args) # def self.scoped_by_user_na
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+.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册