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 Group < ActiveRecord::Base
has_many :users
has_many :articles, through: :users
end
class User < ActiveRecord::Base
belongs_to :group
has_many :articles
end
class Post < ActiveRecord::Base
belongs_to :user
end
class Article < Post
end
Can't auto eager load (or regular eager load) Group#articles.
Underlying issue is rails/rails#11078. Workaround is to set auto_include = false on these associations
The text was updated successfully, but these errors were encountered:
Goldiloader is great, but has several issues with has_many :through relations:
* salsify/goldiloader#12
* salsify/goldiloader#14
* salsify/goldiloader#18
Rather than try to figure out which applies in each case, we should just do the
drudge work of manually disabling autoloading for all relations of this type. We
can always use regular preloading for specific cases, but this way we avoid
generating invalid queries through Goldiloader's magic.
I just tried Goldiloader and immediately had some issue involving the STI type field. However it seems to be fixed in Rails 5.2 (finally) and sure enough upgrading does seem to have fixed my issue :) rails/rails#14312
So, if anyone else experiencing STI issues with Goldiloader could upgrade to Rails 5.2 and confirm that the issue is fixed for them too, then I think this issue could be closed.
Example models:
Can't auto eager load (or regular eager load)
Group#articles
.Underlying issue is rails/rails#11078. Workaround is to set
auto_include = false
on these associationsThe text was updated successfully, but these errors were encountered: