From 66a6a6b45a4e3cee8a33f43111abafb46969ff94 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 13 Oct 2013 17:03:48 -0700 Subject: eliminate single use method --- activerecord/lib/active_record/relation/finder_methods.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/active_record/relation') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index b2d770ba93..92969cfb30 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -243,7 +243,9 @@ module ActiveRecord def find_with_associations join_dependency = construct_join_dependency relation = except :select - relation = construct_relation_for_association_find(join_dependency, relation) + relation = relation.select(join_dependency.columns) + relation = apply_join_dependency(relation, join_dependency) + if block_given? yield relation else @@ -265,11 +267,6 @@ module ActiveRecord apply_join_dependency(self, construct_join_dependency(arel.froms.first)) end - def construct_relation_for_association_find(join_dependency, relation = self) - relation = relation.select(join_dependency.columns) - apply_join_dependency(relation, join_dependency) - end - def apply_join_dependency(relation, join_dependency) relation = relation.except(:includes, :eager_load, :preload) relation = relation.joins join_dependency -- cgit v1.2.3