Skip to content

Commit

Permalink
Fix: Payment deadline query
Browse files Browse the repository at this point in the history
Fix: Add missing payment deadline seeds
  • Loading branch information
TobiasDeBruijn committed Feb 6, 2025
1 parent b45a042 commit e975081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def content_type
where(
'NOT activities.is_payable
AND activities.start_date <= ?
AND (activities.payment_deadline IS NULL OR activities.payment_deadline > ?)',
AND (activities.payment_deadline IS NULL OR activities.payment_deadline <= ?)',
Date.today, Date.today
).joins(:participants)
.where('participants.reservist IS FALSE
Expand Down Expand Up @@ -118,7 +118,7 @@ def self.debtors
joins(:participants).where('
activities.is_payable
AND
(activities.payment_deadline IS NULL OR activities.payment_deadline > ?)
(activities.payment_deadline IS NULL OR activities.payment_deadline <= ?)
AND
participants.reservist IS FALSE
AND
Expand Down
2 changes: 2 additions & 0 deletions db/seeds/activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
description_nl: Faker::Lorem.paragraph(sentence_count: 5),
description_en: Faker::Lorem.paragraph(sentence_count: 5),

payment_deadline: Faker::Boolean.boolean(true_ratio: 0.5) ? Faker::Date::between(from: start_date, to: start_date + 90.days) : nil,

is_enrollable: enrollable,
is_masters: Faker::Boolean.boolean(true_ratio: 0.2),
is_viewable: viewable,
Expand Down

0 comments on commit e975081

Please sign in to comment.