Commit 62600ec3 authored by Robert Speicher's avatar Robert Speicher Committed by Rémy Coutable

Merge branch 'fix-milestone-upcoming' into 'master'

Fix Milestone.upcoming

The order wasn't happening because of `default_scope`. Blegh.

See merge request !3364
parent 5f9595bb
...@@ -8,6 +8,7 @@ v 8.6.2 ...@@ -8,6 +8,7 @@ v 8.6.2
- Make dropdowns pixel perfect. !3337 - Make dropdowns pixel perfect. !3337
- Fix bold text in issuable sidebar. !3358 - Fix bold text in issuable sidebar. !3358
- Fix error with anonymous token in applications settings. !3362 - Fix error with anonymous token in applications settings. !3362
- Fix the milestone 'upcoming' filter. !3364
v 8.6.1 v 8.6.1
- Add option to reload the schema before restoring a database backup. !2807 - Add option to reload the schema before restoring a database backup. !2807
......
...@@ -83,7 +83,7 @@ class Milestone < ActiveRecord::Base ...@@ -83,7 +83,7 @@ class Milestone < ActiveRecord::Base
end end
def self.upcoming def self.upcoming
self.where('due_date > ?', Time.now).order(due_date: :asc).first self.where('due_date > ?', Time.now).reorder(due_date: :asc).first
end end
def to_reference(from_project = nil) def to_reference(from_project = nil)
......
Markdown is supported
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