diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-13 17:03:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-13 17:03:48 -0700 |
commit | 66a6a6b45a4e3cee8a33f43111abafb46969ff94 (patch) | |
tree | fc6cac3424018defd6a3dee9556c915173ecc9a7 /activerecord/lib/active_record/relation | |
parent | 158197b91d34b5ef2a4c06fb12a440d0b88d693d (diff) | |
download | rails-66a6a6b45a4e3cee8a33f43111abafb46969ff94.tar.gz rails-66a6a6b45a4e3cee8a33f43111abafb46969ff94.tar.bz2 rails-66a6a6b45a4e3cee8a33f43111abafb46969ff94.zip |
eliminate single use method
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 9 |
1 files changed, 3 insertions, 6 deletions
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 |