diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-25 16:36:55 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-25 16:36:55 +0900 |
commit | 1a723c65bbe91ad969b67416233d20eff6d2a46a (patch) | |
tree | a9f47b50453696ffcb8c41d1c28494cc4f23af63 /activerecord/lib/active_record/relation/finder_methods.rb | |
parent | cb5af0d750198739d85b99aecd2f69927ec42e6a (diff) | |
download | rails-1a723c65bbe91ad969b67416233d20eff6d2a46a.tar.gz rails-1a723c65bbe91ad969b67416233d20eff6d2a46a.tar.bz2 rails-1a723c65bbe91ad969b67416233d20eff6d2a46a.zip |
Should work inverse association when eager loading
This regression was caused by caa178c1. The block for
`set_inverse_instance` should also be passed to join dependency.
Fixes #30402.
Diffstat (limited to 'activerecord/lib/active_record/relation/finder_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 5da9573052..2aed941916 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -372,16 +372,7 @@ module ActiveRecord relation = select aliases.columns relation = apply_join_dependency(relation, join_dependency) - if block_given? - yield relation - else - if ActiveRecord::NullRelation === relation - [] - else - rows = skip_query_cache_if_necessary { connection.select_all(relation.arel, "SQL") } - join_dependency.instantiate(rows, aliases) - end - end + yield relation, join_dependency end def construct_relation_for_exists(relation, conditions) |