summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-11 18:23:12 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-11 20:50:26 -0300
commit93a10f17e0c84074580eaf1b101af2a0fffd19ed (patch)
treecf601b69b92f4db61a0b41daf6e7a0742a0a0070 /app/services
parent9a44d6977ad27a443538b2b6c34b3fdd722e9bd6 (diff)
downloadgitlab-ce-93a10f17e0c84074580eaf1b101af2a0fffd19ed.tar.gz
Reuse `User#notification_settings_for` when it's possible
Diffstat (limited to 'app/services')
-rw-r--r--app/services/notification_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 0928dda349e..42ec1ac9e1a 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -355,10 +355,10 @@ class NotificationService
users.reject do |user|
next user.notification_level == level unless project
- setting = user.notification_settings.find_by(source: project)
+ setting = user.notification_settings_for(project)
if !setting && project.group
- setting = user.notification_settings.find_by(source: project.group)
+ setting = user.notification_settings_for(project.group)
end
# reject users who globally set mention notification and has no setting per project/group