module BabySqueel::Operators::Generic

Public Instance Methods

op(operator, other) click to toggle source

Create a SQL operation. See Arel::Nodes::InfixOperation.

Arguments

  • operator - A SQL operator.

  • other - The argument to be passed to the SQL operator.

Example

Post.selecting { title.op('||', quoted('diddly')) }
#=> SELECT "posts"."title" || 'diddly' FROM "posts"
# File lib/baby_squeel/operators.rb, line 48
def op(operator, other)
  Nodes.wrap Arel::Nodes::InfixOperation.new(operator, self, other)
end