OSDN Git Service

Respect group membership in notification service
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fri, 21 Jun 2013 20:21:55 +0000 (23:21 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fri, 21 Jun 2013 20:21:55 +0000 (23:21 +0300)
app/services/notification_service.rb

index 1a999a6..ac2820f 100644 (file)
@@ -174,6 +174,10 @@ class NotificationService
 
       tm = project.users_projects.find_by_user_id(user.id)
 
+      if !tm && project.group
+        tm = project.users_groups.find_by_user_id(user.id)
+      end
+
       # reject users who globally disabled notification and has no membership
       next user.notification.disabled? unless tm