diff options
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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 |