aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-12-19 11:54:38 +1030
committerGitHub <noreply@github.com>2017-12-19 11:54:38 +1030
commitd9e4bffb60f69d972311fa7d23f4ce540adc54a9 (patch)
treec4e68a892ceba11e5fc3edec939b06435884b768 /activerecord/lib
parent373a5683240f85d3538fbeeb3eca624c4cb0c90a (diff)
parent876865aba7c0ca2c069ff4be88e9916f5f0f28bd (diff)
downloadrails-d9e4bffb60f69d972311fa7d23f4ce540adc54a9.tar.gz
rails-d9e4bffb60f69d972311fa7d23f4ce540adc54a9.tar.bz2
rails-d9e4bffb60f69d972311fa7d23f4ce540adc54a9.zip
Merge pull request #31475 from shioyama/reset_column_information_redefine_child_attribute_methods
Undefine attribute methods of descendants when resetting column information
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/model_schema.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb
index 773b0f6cde..fa7537c1a3 100644
--- a/activerecord/lib/active_record/model_schema.rb
+++ b/activerecord/lib/active_record/model_schema.rb
@@ -425,7 +425,7 @@ module ActiveRecord
# end
def reset_column_information
connection.clear_cache!
- undefine_attribute_methods
+ ([self] + descendants).each(&:undefine_attribute_methods)
connection.schema_cache.clear_data_source_cache!(table_name)
reload_schema_from_cache