1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib
eileencodes 3328cd1d69
Ensure reload re-applies preload values for strict loading
If you have an application that has strict_loading set and then call
`reload` that would cause the preload values to get lost and
applications would start throwing a stict loading violation error.

In order to fix this we capture the association cache and re-apply that
to the reloaded records to avoid the strict loading error. Of course if
you never preloaded your records, this will still raise a strict loading
violation.

This change also removes the `reload` definition from associations.rb
because we can get the same behavior when we reassign the association
cache.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-04-26 15:45:39 -04:00
..
active_record Ensure reload re-applies preload values for strict loading 2021-04-26 15:45:39 -04:00
arel Replace map + compact with filter_map 2021-04-22 22:08:34 -03:00
rails/generators Set ApplicationRecord to primary_abstract_class 2021-02-05 17:02:08 -05:00
active_record.rb Add option to skip joins for associations. 2021-04-19 11:17:31 -04:00
arel.rb