diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-19 13:03:28 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-04-20 15:43:32 -0400 |
commit | 6cdf4acd4eef55c616d633757772c6e05f6b93c5 (patch) | |
tree | 10fb609f5a9418c3f57ef3506b95f0be7c06e14c /app/finders | |
parent | 5c8959bbc15ec47d8be62e8e1362e441cdd91d69 (diff) | |
download | gitlab-ce-6cdf4acd4eef55c616d633757772c6e05f6b93c5.tar.gz |
Address MR feedback
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 7613283443a..e21cfbd0d47 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -122,7 +122,7 @@ class IssuableFinder end def filter_by_overdue? - due_date? && params[:due_date] == Issue::OverDue.name + due_date? && params[:due_date] == Issue::Overdue.name end def filter_by_due_this_week? @@ -305,17 +305,20 @@ class IssuableFinder end def by_due_date(items) + return items unless klass.column_names.include?('due_date') + if due_date? if filter_by_no_due_date? items = items.without_due_date elsif filter_by_overdue? - items = items.overdue + items = items.due_before(Date.today) elsif filter_by_due_this_week? - items = items.due_between(Date.today.beginning_of_week, Date.today.end_of_week + 1.day) + items = items.due_between(Date.today.beginning_of_week, Date.today.end_of_week) elsif filter_by_due_this_month? - items = items.due_between(Date.today.beginning_of_month, Date.today.end_of_month + 1.day) + items = items.due_between(Date.today.beginning_of_month, Date.today.end_of_month) end end + items end |