diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb index 42ff1d7d54..e6b8e3ae90 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb @@ -74,13 +74,10 @@ module ActiveRecord @query_cache[sql] = yield end - case result - when Array + if Array === result result.collect { |row| row.dup } - when nil, Fixnum, Float, true, false - result else - result.dup + result.duplicable? ? result.dup : result end rescue TypeError result |