summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-04-18 09:33:44 +0000
committerDouwe Maan <douwe@gitlab.com>2018-04-18 09:33:44 +0000
commit84eeb9468c16f7192f9e3b911beeb6e472f4b907 (patch)
tree00a597d24e9ecd2972cd61a1b16c8abbb106cdae /app/models
parent40653b65b6a45df358ce40a278b08982891c541e (diff)
parentab650e7c6753d2f4c418496ad74dc87e243a5b2b (diff)
downloadgitlab-ce-84eeb9468c16f7192f9e3b911beeb6e472f4b907.tar.gz
Merge branch 'stuartnelson3/gitlab-ce-stn/issue-due-email' into 'master'
Email notification on issue due date Closes #27500 See merge request gitlab-org/gitlab-ce!17985
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb1
-rw-r--r--app/models/notification_setting.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index c1ffe6512ea..702bfc77803 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -49,6 +49,7 @@ class Issue < ActiveRecord::Base
scope :without_due_date, -> { where(due_date: nil) }
scope :due_before, ->(date) { where('issues.due_date < ?', date) }
scope :due_between, ->(from_date, to_date) { where('issues.due_date >= ?', from_date).where('issues.due_date <= ?', to_date) }
+ scope :due_tomorrow, -> { where(due_date: Date.tomorrow) }
scope :order_due_date_asc, -> { reorder('issues.due_date IS NULL, issues.due_date ASC') }
scope :order_due_date_desc, -> { reorder('issues.due_date IS NULL, issues.due_date DESC') }
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index f6d9b0215fc..9195408551f 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -47,7 +47,8 @@ class NotificationSetting < ActiveRecord::Base
].freeze
EXCLUDED_WATCHER_EVENTS = [
- :push_to_merge_request
+ :push_to_merge_request,
+ :issue_due
].push(*EXCLUDED_PARTICIPATING_EVENTS).freeze
def self.find_or_create_for(source)