1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/associations
Sean Griffin caa178c178 Ensure that inverse associations are set before running callbacks
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.
2016-08-31 09:26:25 -04:00
..
association_scope_test.rb applies new string literal convention in activerecord/test 2016-08-06 18:26:53 +02:00
belongs_to_associations_test.rb Don't unnecessarily load a belongs_to when saving. 2016-08-26 11:40:38 -04:00
bidirectional_destroy_dependencies_test.rb applies new string literal convention in activerecord/test 2016-08-06 18:26:53 +02:00
callbacks_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
cascaded_eager_loading_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
eager_load_includes_full_sti_class_test.rb applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
eager_load_nested_include_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
eager_singularization_test.rb Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
eager_test.rb Merge pull request #24099 from k0kubun/preserve-readonly 2016-08-18 23:17:23 -03:00
extension_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
has_and_belongs_to_many_associations_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
has_many_associations_test.rb Merge pull request #26009 from kamipo/fix_inconsistent_finder_methods_signature 2016-08-17 00:11:34 -03:00
has_many_through_associations_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
has_one_associations_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
has_one_through_associations_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
inner_join_association_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
inverse_associations_test.rb Ensure that inverse associations are set before running callbacks 2016-08-31 09:26:25 -04:00
join_model_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
left_outer_join_association_test.rb Fix count which would sometimes force a DISTINCT 2016-08-16 09:45:23 -04:00
nested_through_associations_test.rb modernizes hash syntax in activerecord 2016-08-06 19:37:57 +02:00
required_test.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00