Method: Sequel::Plugins::SubsetConditions::DatasetModuleMethods#where_all
- Defined in:
- lib/sequel/plugins/subset_conditions.rb
#where_all(name, *args) ⇒ Object
Create a method that combines filters from already registered dataset methods, and filters for rows where all of the conditions are satisfied.
Employee.dataset_module do
where :active, active: true
where :started, Sequel::CURRENT_DATE <= :start_date
where_all(:active_and_started, :active, :started)
end
Employee.active_and_started.sql
# SELECT * FROM employees WHERE ((active IS TRUE) AND (CURRENT_DATE <= start_date))
86 87 88 |
# File 'lib/sequel/plugins/subset_conditions.rb', line 86 def where_all(name, *args) _where_any_all(:&, name, args) end |