diff options
author | DmitryTsepelev <dmitry.a.tsepelev@gmail.com> | 2018-11-26 11:12:42 +0300 |
---|---|---|
committer | DmitryTsepelev <dmitry.a.tsepelev@gmail.com> | 2018-11-27 16:30:26 +0300 |
commit | d34c1fc3d64e51f9aeecfbffefd843e744dfbeac (patch) | |
tree | 64ee1bded54ac99df7eb170b85faa7db0b410294 /activerecord/lib/active_record/querying.rb | |
parent | b9c7305dbe57931a153a540d49ae5d469af61a14 (diff) | |
download | rails-d34c1fc3d64e51f9aeecfbffefd843e744dfbeac.tar.gz rails-d34c1fc3d64e51f9aeecfbffefd843e744dfbeac.tar.bz2 rails-d34c1fc3d64e51f9aeecfbffefd843e744dfbeac.zip |
Cached columns_hash fields should be excluded from ResultSet#column_types
Diffstat (limited to 'activerecord/lib/active_record/querying.rb')
-rw-r--r-- | activerecord/lib/active_record/querying.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb index c84f3d0fbb..0c55284f4c 100644 --- a/activerecord/lib/active_record/querying.rb +++ b/activerecord/lib/active_record/querying.rb @@ -40,7 +40,8 @@ module ActiveRecord def find_by_sql(sql, binds = [], preparable: nil, &block) result_set = connection.select_all(sanitize_sql(sql), "#{name} Load", binds, preparable: preparable) column_types = result_set.column_types.dup - columns_hash.each_key { |k| column_types.delete k } + cached_columns_hash = connection.schema_cache.columns_hash(table_name) + cached_columns_hash.each_key { |k| column_types.delete k } message_bus = ActiveSupport::Notifications.instrumenter payload = { |