class ActiveRecord::QueryMethods::WhereIsArel

Attributes

arel_field[RW]

Public Class Methods

new(arel_field) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 10
def initialize(arel_field)
  self.arel_field = arel_field
end

Public Instance Methods

!=(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 34
def !=(other)
  arel_field.not_eq parse_other(other)
end
<(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 22
def <(other)
  arel_field.lt parse_other(other)
end
<=(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 26
def <=(other)
  arel_field.lteq parse_other(other)
end
==(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 30
def ==(other)
  arel_field.eq parse_other(other)
end
=~(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 38
def =~(other)
  other = other.source if other.is_a?(Regexp)
  arel_field.matches_regexp parse_other(other)
end
>(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 14
def >(other)
  arel_field.gt parse_other(other)
end
>=(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 18
def >=(other)
  arel_field.gteq parse_other(other)
end
in?(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 43
def in?(other)
  arel_field.eq_any parse_other(other)
end
method_missing(method_name, params = {}) click to toggle source
Calls superclass method
# File lib/where-is-rails/where-is-rails.rb, line 47
def method_missing(method_name, params = {})
  return arel_field.send(method_name, params) if arel_field.respond_to? method_name

  super
end

Private Instance Methods

parse_other(other) click to toggle source
# File lib/where-is-rails/where-is-rails.rb, line 55
def parse_other(other)
  other.is_a?(WhereIsArel) ? other.arel_field : other
end