From 752a06ea8d76a072a4cf51594f47d8a4c6c2edd6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 9 Oct 2013 15:21:34 -0700 Subject: hide join_constraints inside the JoinDependency object --- .../lib/active_record/associations/join_dependency.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 433855ceea..4d1f7a1041 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -75,20 +75,20 @@ module ActiveRecord self end - def join_associations - join_root.drop 1 - end - def reflections - join_associations.map(&:reflection) + join_root.drop(1).map(&:reflection) end def join_relation(relation) - join_associations.inject(relation) do |rel,association| + join_root.drop(1).inject(relation) do |rel,association| association.join_relation(rel) end end + def join_constraints + join_root.drop(1).flat_map(&:join_constraints) + end + def columns join_root.collect { |join_part| table = join_part.aliased_table -- cgit v1.2.3