Module: ArelExtensions::Comparators

Included in:
Attributes, Nodes::Soundex
Defined in:
lib/arel_extensions/comparators.rb

Instance Method Summary collapse

Instance Method Details

#!~(other) ⇒ Object

NOT_REGEXP function Negation of Regexp



32
33
34
35
36
37
# File 'lib/arel_extensions/comparators.rb', line 32

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



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

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

#<=(other) ⇒ Object



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

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

#=~(other) ⇒ Object

REGEXP function Pattern matching using regular expressions



23
24
25
26
27
28
# File 'lib/arel_extensions/comparators.rb', line 23

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



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

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

#>=(other) ⇒ Object



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

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