提交 42d1172c 编写于 作者: M Michael Koziarski

Add OrderedHash#to_hash. Closes #11266 [josh]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 b18585fb
*SVN*
* Add OrderedHash#to_hash [josh]
* Adding Time#end_of_day, _quarter, _week, and _year. #9312 [Juanjo Bazan, Tarmo Tänav, BigTitus]
* Adding TimeWithZone#between? [Geoff Buesing]
......
......@@ -26,6 +26,12 @@ def keys
def values
collect { |key, value| value }
end
def to_hash
returning({}) do |hash|
each { |array| hash[array[0]] = array[1] }
end
end
end
end
end
......
......@@ -22,6 +22,7 @@ def test_group_by
end
assert_equal objects.uniq.map(&:name), grouped.keys
assert({}.merge(grouped), "Could not convert ActiveSupport::OrderedHash into Hash")
end
def test_sums
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册