aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2019-03-12 22:42:50 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2019-03-12 22:42:50 +0100
commitf45084c746a79cee3ff6c08fc4e42be15cac2bba (patch)
treeb8a132c4a57f51082051ae8fbdeae9d0503b6f32 /activerecord/lib/active_record/connection_adapters
parent8b3d2d1a717d795dd443d37ab762f82c2bccd6c1 (diff)
downloadrails-f45084c746a79cee3ff6c08fc4e42be15cac2bba.tar.gz
rails-f45084c746a79cee3ff6c08fc4e42be15cac2bba.tar.bz2
rails-f45084c746a79cee3ff6c08fc4e42be15cac2bba.zip
Modernize size calculation in Schema Cache
Not looking for other contributions like this, but I took the liberty since I was already working on this.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/schema_cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/schema_cache.rb b/activerecord/lib/active_record/connection_adapters/schema_cache.rb
index c10765f42d..2653e3c74e 100644
--- a/activerecord/lib/active_record/connection_adapters/schema_cache.rb
+++ b/activerecord/lib/active_record/connection_adapters/schema_cache.rb
@@ -92,7 +92,7 @@ module ActiveRecord
end
def size
- [@columns, @columns_hash, @primary_keys, @data_sources].map(&:size).inject :+
+ [@columns, @columns_hash, @primary_keys, @data_sources].sum(&:size)
end
# Clear out internal caches for the data source +name+.