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/active_record/associations
John Hawthorn 20b9bb1de0 Intelligent batch preloading
This examines all the association branches we are being asked to preload
and will delay loading an association if it's likely that we find a
similar association later and can batch them together.

For example, when loading

    Author.preload(:posts, favorite_authors: :posts).first

The preloader now knows to delay loading the top level posts so that it
can load both the top level :posts and the :posts from the favourite
authors associations together.

Co-authored-by: Dinah Shi <dinahshi@github.com>
2021-04-01 12:52:43 -07:00
..
builder Refactoring the code to not add methods to all models 2021-02-01 23:26:04 +00:00
join_dependency Fix through association with through scope which has joins 2021-01-06 21:29:11 +09:00
preloader Intelligent batch preloading 2021-04-01 12:52:43 -07:00
alias_tracker.rb Allow where references association names as joined table alias names 2020-08-26 10:07:13 +09:00
association.rb Add n_plus_one_only mode to Core#strict_loading! 2021-03-24 20:55:18 -04:00
association_scope.rb Fix through association with through scope which has joins 2021-01-06 21:29:11 +09:00
belongs_to_association.rb Fix rollback of parent destruction with nested dependent:destroy 2021-03-03 12:51:35 +01:00
belongs_to_polymorphic_association.rb Use _read_attribute instead of [] 2021-01-11 23:19:21 +00:00
collection_association.rb Remove unused requires on lib/active_record/associations.rb 2021-02-06 12:54:22 -03:00
collection_proxy.rb CollectionProxy#any? docs: Mention "load.any?" 2021-03-05 12:38:52 -05:00
foreign_association.rb Move set_owner_attributes into ForeignAssociation 2020-06-21 08:12:55 +09:00
has_many_association.rb Handle STI models for has_many dependent: :destroy_async 2021-01-06 02:04:23 +01:00
has_many_through_association.rb Implicit scoping does no longer leak scope to class level querying methods 2020-10-30 00:25:38 +00:00
has_one_association.rb Every primary_key column is supposed to be a public method 2020-10-02 21:51:10 +09:00
has_one_through_association.rb
join_dependency.rb Fix joins that reserved word association is referenced in where 2021-01-18 16:24:22 +09:00
preloader.rb Implement Preloader::Branch 2021-03-15 12:36:21 -07:00
singular_association.rb Make the method signature of association.build the same as klass.build and relation.build 2019-10-20 02:51:59 +09:00
through_association.rb Fix through association with source/through scope which has joins 2020-05-22 04:05:27 +09:00