mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
caa178c178
If a parent association was accessed in an `after_find` or `after_initialize` callback, it would always end up loading the association, and then immediately overwriting the association we just loaded. If this occurred in a way that the parent's `current_scope` was set to eager load the child, this would result in an infinite loop and eventually overflow the stack. For records that are created with `.new`, we have a mechanism to perform an action before the callbacks are run. I've introduced the same code path for records created with `instantiate`, and updated all code which sets inverse instances on newly loaded associations to use this block instead. Fixes #26320. |
||
---|---|---|
.. | ||
association_scope_test.rb | ||
belongs_to_associations_test.rb | ||
bidirectional_destroy_dependencies_test.rb | ||
callbacks_test.rb | ||
cascaded_eager_loading_test.rb | ||
eager_load_includes_full_sti_class_test.rb | ||
eager_load_nested_include_test.rb | ||
eager_singularization_test.rb | ||
eager_test.rb | ||
extension_test.rb | ||
has_and_belongs_to_many_associations_test.rb | ||
has_many_associations_test.rb | ||
has_many_through_associations_test.rb | ||
has_one_associations_test.rb | ||
has_one_through_associations_test.rb | ||
inner_join_association_test.rb | ||
inverse_associations_test.rb | ||
join_model_test.rb | ||
left_outer_join_association_test.rb | ||
nested_through_associations_test.rb | ||
required_test.rb |