diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2019-03-07 20:21:34 +0300 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-03-07 20:21:34 +0300 |
commit | a1a8202f081f75431dee14e246cd55acaddba2aa (patch) | |
tree | 7e314479ddb0e5d2210f1e08a1be2acc8940c9ce /app | |
parent | 5211386293cdd95fd6161019716301f806749137 (diff) | |
parent | 8b9b37f6c86bfc049f0b4fc785ae01d94545ab48 (diff) |
Merge branch 'use-date-for-upcoming-milestone-comparison' into 'master'
Use date for upcoming milestone comparison
Closes #58325
See merge request gitlab-org/gitlab-ce!25806
Diffstat (limited to 'app')
-rw-r--r-- | app/models/milestone.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 26cfdc5ef30..d6f94cad1fb 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -149,7 +149,7 @@ class Milestone < ActiveRecord::Base def self.upcoming_ids(projects, groups) rel = unscoped .for_projects_and_groups(projects, groups) - .active.where('milestones.due_date > NOW()') + .active.where('milestones.due_date > CURRENT_DATE') if Gitlab::Database.postgresql? rel.order(:project_id, :group_id, :due_date).select('DISTINCT ON (project_id, group_id) id') @@ -161,7 +161,7 @@ class Milestone < ActiveRecord::Base ON milestones.project_id <=> earlier_milestones.project_id AND milestones.group_id <=> earlier_milestones.group_id AND milestones.due_date > earlier_milestones.due_date - AND earlier_milestones.due_date > NOW() + AND earlier_milestones.due_date > CURRENT_DATE AND earlier_milestones.state = 'active' HEREDOC |