提交 0580f5a6 编写于 作者: E Emilio Tagua 提交者: Santiago Pastorino

No need to use inject here, use map instead.

Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
上级 4513cc14
......@@ -13,10 +13,7 @@ def read_attribute_before_type_cast(attr_name)
# Returns a hash of attributes before typecasting and deserialization.
def attributes_before_type_cast
self.attribute_names.inject({}) do |attrs, name|
attrs[name] = read_attribute_before_type_cast(name)
attrs
end
Hash[attribute_names.map { |name| [name, read_attribute_before_type_cast(name)] }]
end
private
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册