Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't auto eager load associations with instance dependent scopes #20

Closed
jturkel opened this issue Oct 25, 2014 · 1 comment
Closed
Labels

Comments

@jturkel
Copy link
Member

jturkel commented Oct 25, 2014

Rails 4 and above support instance dependent association scopes which cannot be eager loaded e.g.

class Blog < ActiveRecord::Base
  has_many :posts, ->(instance) { Post.where(blog_id: instance.id) }, class_name: 'Post'
end

Goldiloader should disable auto eager loading for these associations.

Noticed this because Rails 4.2 added a deprecation warning when attempting to eager load these associations.

@jturkel jturkel added the bug label Oct 25, 2014
@jturkel jturkel changed the title Don't auto eager load scopes with instance dependent scopes Don't auto eager load associations with instance dependent scopes Oct 25, 2014
@jturkel
Copy link
Member Author

jturkel commented Oct 25, 2014

Fixed in 5d25767

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant