method
merge_joins
v5.2.3 -
Show latest stable
- Class:
ActiveRecord::Relation::Merger
merge_joins()private
No documentation available.
# File activerecord/lib/active_record/relation/merger.rb, line 114
def merge_joins
return if other.joins_values.blank?
if other.klass == relation.klass
relation.joins!(*other.joins_values)
else
joins_dependency = other.joins_values.map do |join|
case join
when Hash, Symbol, Array
ActiveRecord::Associations::JoinDependency.new(
other.klass, other.table, join
)
else
join
end
end
relation.joins!(*joins_dependency)
end
end