mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Undefine attribute methods on all descendants when resetting column info
If we don't do this, then we end up with an inconsistent situation where a parent class may e.g. reset column information, but child classes will contine to see attribute methods as already generated, and thus not pick up this new column (falling through to method_missing).
This commit is contained in:
parent
4aee5fcbfb
commit
e1ceb10fa8
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue