14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/squeel/adapters/active_record/join_dependency_extensions.rb', line 14
def build_with_squeel(associations, parent = nil, join_type = Arel::InnerJoin)
case associations
when Nodes::Stub
associations = associations.symbol
when Nodes::Join
associations = associations._join
end
if Nodes::KeyPath === associations
parent ||= _join_parts.last
associations.path_with_endpoint.each do |key|
parent = build(key, parent, join_type)
end
parent
else
build_without_squeel(associations, parent, join_type)
end
end
|