Module: ArelExtensions::Comparators

Instance Method Summary collapse

Instance Method Details

#!~(other) ⇒ Object

NOT_REGEXP function Negation of Regexp



30
31
32
33
34
35
# File 'lib/arel_extensions/comparators.rb', line 30

def !~(other)
    #      arg = self.relation.engine.connection.schema_cache.columns_hash(self.relation.table_name)[self.name.to_s].type
    #      if arg == :string || arg == :text
  Arel::Nodes::NotRegexp.new self, convert_regexp(other)
  #      end
end

#<(other) ⇒ Object



11
12
13
# File 'lib/arel_extensions/comparators.rb', line 11

def <(other)
  Arel::Nodes::LessThan.new self, Arel.quoted(other, self)
end

#<=(other) ⇒ Object



15
16
17
# File 'lib/arel_extensions/comparators.rb', line 15

def <=(other)
  Arel::Nodes::LessThanOrEqual.new self, Arel.quoted(other, self)
end

#=~(other) ⇒ Object

REGEXP function Pattern matching using regular expressions



21
22
23
24
25
26
# File 'lib/arel_extensions/comparators.rb', line 21

def =~(other)
    #      arg = self.relation.engine.connection.schema_cache.columns_hash(self.relation.table_name)[self.name.to_s].type
    #      if arg == :string || arg == :text
  Arel::Nodes::Regexp.new self, convert_regexp(other)
  #      end
end

#>(other) ⇒ Object



3
4
5
# File 'lib/arel_extensions/comparators.rb', line 3

def >(other)
  Arel::Nodes::GreaterThan.new self, Arel.quoted(other, self)
end

#>=(other) ⇒ Object



7
8
9
# File 'lib/arel_extensions/comparators.rb', line 7

def >=(other)
  Arel::Nodes::GreaterThanOrEqual.new self, Arel.quoted(other, self)
end