Skip to content

Commit

Permalink
ISSUE #448: Fixing the on_date scope logic
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMonardez committed Oct 24, 2024
1 parent d2ed6fe commit 0c3f18f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/program_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class ProgramLevel < ApplicationRecord
validates :end_date, presence: false

scope :active, -> { where(end_date: nil) }
scope :on_date, -> (date) { where("program_levels.start_date <= ? (AND program_levels.end_date > ? OR program_levels.end_date is null)", date, date)}
scope :on_date, -> (date) { where("program_levels.start_date <= ? AND (program_levels.end_date > ? OR program_levels.end_date is null)", date, date)}

end

0 comments on commit 0c3f18f

Please sign in to comment.