method
merge
v5.2.3 -
Show latest stable
- Class:
ActiveRecord::Relation::Merger
merge()public
No documentation available.
# File activerecord/lib/active_record/relation/merger.rb, line 65
def merge
normal_values.each do |name|
value = values[name]
# The unless clause is here mostly for performance reasons (since the `send` call might be moderately
# expensive), most of the time the value is going to be `nil` or `.blank?`, the only catch is that
# `false.blank?` returns `true`, so there needs to be an extra check so that explicit `false` values
# don't fall through the cracks.
unless value.nil? || (value.blank? && false != value)
if name == :select
relation._select!(*value)
else
relation.send("#{name}!", *value)
end
end
end
merge_multi_values
merge_single_values
merge_clauses
merge_preloads
merge_joins
merge_outer_joins
relation
end