aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/finder_methods.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-08-25 16:36:55 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-08-25 16:36:55 +0900
commit1a723c65bbe91ad969b67416233d20eff6d2a46a (patch)
treea9f47b50453696ffcb8c41d1c28494cc4f23af63 /activerecord/lib/active_record/relation/finder_methods.rb
parentcb5af0d750198739d85b99aecd2f69927ec42e6a (diff)
downloadrails-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.rb11
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)