Class: ActiveRecord::QueryMethods::WhereChain

Inherits:
Object
  • Object
show all
Defined in:
lib/where-is-rails/where-is-rails.rb

Instance Method Summary collapse

Instance Method Details

#is(&block) ⇒ Object



74
75
76
77
78
# File 'lib/where-is-rails/where-is-rails.rb', line 74

def is(&block)
  arel_table = @scope.klass.arel_table

  @scope.where WhereIs.new(arel_table, &block).result
end

#is_not(&block) ⇒ Object



80
81
82
83
84
# File 'lib/where-is-rails/where-is-rails.rb', line 80

def is_not &block
  arel_table = @scope.klass.arel_table

  self.not WhereIs.new(arel_table, &block).result
end