We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:inverse_of association option not working with eager_loading.
:inverse_of
class User < ActiveRecord::Base has_many :posts, inverse_of: :user end class Post < ActiveRecord::Base belongs_to :user, inverse_of: :posts belongs_to :category end user = User.first puts "without eager_loading:" puts user.object_id == user.posts.first.user.object_id puts "" puts "with eager_loading:" puts user.object_id == user.posts.eager_load(:category).first.user.object_id
Expected outputs are as below.
without eager_loading: true with eager_loading: true
Actually like this.
without eager_loading: true with eager_loading: false
In my survey, it derives from changes in 5.1 release.
The block passed to super method isn't executed with eager_loading.
Is this intended change?
Rails version: 5.1.2
Ruby version: 2.3.1
The text was updated successfully, but these errors were encountered:
1a723c6
Thanks for the report. This regression was caused by caa178c. Fixed in 1a723c6.
Sorry, something went wrong.
Should work inverse association when eager loading
237f00c
This regression was caused by caa178c. The block for `set_inverse_instance` should also be passed to join dependency. Fixes #30402.
No branches or pull requests
:inverse_of
association option not working with eager_loading.Steps to reproduce
Expected behavior
Expected outputs are as below.
Actual behavior
Actually like this.
Further note
In my survey, it derives from changes in 5.1 release.
The block passed to super method isn't executed with eager_loading.
Is this intended change?
System configuration
Rails version: 5.1.2
Ruby version: 2.3.1
The text was updated successfully, but these errors were encountered: