Module: BabySqueel::Operators::Generic
- Included in:
- Nodes::Node
- Defined in:
- lib/baby_squeel/operators.rb
Instance Method Summary collapse
-
#op(operator, other) ⇒ Object
Create a SQL operation.
Instance Method Details
#op(operator, other) ⇒ Object
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"
48 49 50 |
# File 'lib/baby_squeel/operators.rb', line 48 def op(operator, other) Nodes.wrap Arel::Nodes::InfixOperation.new(operator, self, other) end |