8 9 10 11 12 13 14 15 16
# File 'app/models/renalware/pd/regimes_in_date_range_query.rb', line 8 def call scope = Renalware::PD::Regime.order(start_date: :asc, end_date: :desc) scope .where(conditions.merge(end_date: from..to)) .or( scope.where(conditions.merge(end_date: nil)) ) end