Class: ActiveItem::WhereChain

Inherits:
Object
  • Object
show all
Defined in:
lib/active_item/relation.rb

Overview

WhereChain enables the where.not(...) syntax Returns a Relation with negated conditions

Examples:

Container.where.not(parent_container_id: nil)  # Has a parent
Container.where.not(status: 'deleted')         # Not deleted
Container.where.not(status: ['a', 'b'])        # Not in array

Instance Method Summary collapse

Constructor Details

#initialize(relation) ⇒ WhereChain

Returns a new instance of WhereChain.



1969
1970
1971
# File 'lib/active_item/relation.rb', line 1969

def initialize(relation)
  @relation = relation
end

Instance Method Details

#not(**conditions) ⇒ Object



1973
1974
1975
# File 'lib/active_item/relation.rb', line 1973

def not(**conditions)
  @relation.not(**conditions)
end