Module: PlainModel::Querying::Where
- Extended by:
- ActiveSupport::Concern
- Included in:
- PlainModel::QueryBuilder
- Defined in:
- lib/plain_model/querying/where.rb
Instance Method Summary collapse
- #initial_values ⇒ Object
-
#where(*conditions) ⇒ Object
Chain method.
-
#where!(*conditions) ⇒ Object
Chain method.
Instance Method Details
#initial_values ⇒ Object
10 11 12 |
# File 'lib/plain_model/querying/where.rb', line 10 def initial_values super.merge where: [] end |
#where(*conditions) ⇒ Object
Chain method
17 18 19 |
# File 'lib/plain_model/querying/where.rb', line 17 def where(*conditions) dup.where!(*conditions) end |
#where!(*conditions) ⇒ Object
Chain method
24 25 26 27 |
# File 'lib/plain_model/querying/where.rb', line 24 def where!(*conditions) values[:where] = (values[:where] + conditions).uniq self end |