提交 6a3d6b7f 编写于 作者: A Aaron Patterson

select_all() should always return an array, so no need to test

上级 f6ddb355
require 'active_support/core_ext/object/duplicable'
module ActiveRecord
module ConnectionAdapters # :nodoc:
module QueryCache
......@@ -68,13 +66,7 @@ def cache_sql(sql, binds)
@query_cache[sql][binds] = yield
end
if Array === result
result.collect { |row| row.dup }
else
result.duplicable? ? result.dup : result
end
rescue TypeError
result
result.collect { |row| row.dup }
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册