You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If multiple records in a collection have the same record set for a belongs_to, which itself has a has_many association, the has_many association will return duplicate records. When using ActiveRecord's preload, there are no duplicate records.
If multiple records in a collection have the same record set for a
belongs_to
, which itself has ahas_many
association, thehas_many
association will return duplicate records. When using ActiveRecord'spreload
, there are no duplicate records.Example:
This also results in AR making two identical queries for the
phone_numbers
instead of only one.Here's a spec which replicates the problem: https://github.com/clio/jit_preloader/pull/31/files. Seems to only happen under Rails 6.
The text was updated successfully, but these errors were encountered: