Method: Sequel::SQL::CaseExpression#with_merged_expression

Defined in:
lib/sequel/sql.rb

#with_merged_expressionObject

Merge the CASE expression into the conditions, useful for databases that don’t support CASE expressions.



1229
1230
1231
1232
1233
1234
1235
1236
# File 'lib/sequel/sql.rb', line 1229

def with_merged_expression
  if expression?
    e = expression
    CaseExpression.new(conditions.map{|c, r| [::Sequel::SQL::BooleanExpression.new(:'=', e, c), r]}, default)
  else
    self
  end
end