Module: SexyScopes::Arel::Math

Includes:
Typecasting
Included in:
ExpressionMethods
Defined in:
lib/sexy_scopes/arel/math.rb

Instance Method Summary collapse

Instance Method Details

#*(other) ⇒ Object



6
7
8
# File 'lib/sexy_scopes/arel/math.rb', line 6

def *(other)
  SexyScopes.extend_expression(super)
end

#+(other) ⇒ Object



10
11
12
# File 'lib/sexy_scopes/arel/math.rb', line 10

def +(other)
  SexyScopes.extend_expression(super)
end

#-(other) ⇒ Object



14
15
16
# File 'lib/sexy_scopes/arel/math.rb', line 14

def -(other)
  SexyScopes.extend_expression(super)
end

#/(other) ⇒ Object



18
19
20
# File 'lib/sexy_scopes/arel/math.rb', line 18

def /(other)
  SexyScopes.extend_expression(super)
end

#coerce(other) ⇒ Object



22
23
24
25
# File 'lib/sexy_scopes/arel/math.rb', line 22

def coerce(other)
  expression = ::Arel.sql(other.to_s)
  [SexyScopes.extend_expression(expression), self]
end