#283: Email notifications and ActivityFeed for publisher
This commit is contained in:
parent
01380be9a7
commit
b7cc64c099
|
@ -448,17 +448,15 @@ class BuildList < ActiveRecord::Base
|
|||
|
||||
def notify_users
|
||||
unless mass_build_id
|
||||
users = []
|
||||
if project # find associated users
|
||||
users = project.all_members.
|
||||
select{ |user| user.notifier.can_notify? && user.notifier.new_associated_build? }
|
||||
end
|
||||
if user.notifier.can_notify? && user.notifier.new_build?
|
||||
users = users | [user]
|
||||
end
|
||||
users.each do |user|
|
||||
UserMailer.build_list_notification(self, user).deliver
|
||||
end
|
||||
users = [user]
|
||||
users << publisher if publisher
|
||||
users.select!{ |u| u.notifier.can_notify? && u.notifier.new_build? }
|
||||
|
||||
# find associated users
|
||||
users |= project.all_members.select do |u|
|
||||
u.notifier.can_notify? && u.notifier.new_associated_build?
|
||||
end if project
|
||||
users.each{ |u| UserMailer.build_list_notification(self, u).deliver }
|
||||
end
|
||||
end # notify_users
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ module Modules::Observers::ActivityFeed::BuildList
|
|||
)
|
||||
|
||||
updater = publisher || user
|
||||
project.admins.each do |recipient|
|
||||
(project.admins | [publisher].compact).each do |recipient|
|
||||
ActivityFeed.create(
|
||||
:user => recipient,
|
||||
:kind => 'build_list_notification',
|
||||
|
|
Loading…
Reference in New Issue