Verified Commit ad95ef75 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix wrong date between scope for with_billable_hours and hours semester scopes

- they where useing date_between instead of date_between_inclusion

^
parent 7c38ce11
Pipeline #22964 failed with stage
in 35 minutes and 32 seconds
......@@ -22,7 +22,10 @@ class Hour < ApplicationRecord
if date.present?
date = Time.zone.parse(date) unless date.is_a? Time
return if date.blank?
date_between(:meeting_date, date, date.advance(months: BillingExpense::SEMESTER_LENGTH))
date_between_inclusion(:meeting_date, date,
date.advance(months: BillingExpense::SEMESTER_LENGTH))
else
all
end
}
......
......@@ -208,7 +208,7 @@ class Volunteer < ApplicationRecord
scope :with_billable_hours_meeting_date_semester, lambda { |date|
return all if date.blank?
where('hours.meeting_date < :end_date AND hours.meeting_date >= :start_date',
where('hours.meeting_date BETWEEN :start_date AND :end_date',
start_date: date,
end_date: date.advance(months: BillingExpense::SEMESTER_LENGTH))
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment