module PlainModel::Querying::Where

Public Instance Methods

initial_values() click to toggle source
Calls superclass method
# File lib/plain_model/querying/where.rb, line 10
def initial_values
  super.merge where: []
end
where(*conditions) click to toggle source

Chain method @param conditions [Array] @return new instance with applied changes

# File lib/plain_model/querying/where.rb, line 17
def where(*conditions)
  dup.where!(*conditions)
end
where!(*conditions) click to toggle source

Chain method @param conditions [Array] @return current instance with applied changes

# File lib/plain_model/querying/where.rb, line 24
def where!(*conditions)
  values[:where] = (values[:where] + conditions).uniq
  self
end