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
class Post < ActiveRecord::Base
has_and_belongs_to_many :authors, uniq: true
end
class Author < ActiveRecord::Base
has_and_belongs_to_many :posts, uniq: true
end
The uniq option is ignored by Rails when eager loading Post#authors.
Note this is only a problem in Rails 3 since the uniq option was removed in Rails 4 (in favor of using a lambda to customize the association scope).
The text was updated successfully, but these errors were encountered:
jturkel
changed the title
Auto eager loading broken for associations that use the uniq option
Auto eager loading broken for has_and_belongs_to_many associations that use the uniq option
Sep 12, 2014
Consider the following models:
The
uniq
option is ignored by Rails when eager loadingPost#authors
.Note this is only a problem in Rails 3 since the
uniq
option was removed in Rails 4 (in favor of using a lambda to customize the association scope).The text was updated successfully, but these errors were encountered: