Merge branch 'dev_aliyun' into develop

dev_cs_new
daiao 6 years ago
commit 2cbe6849ce

@ -22,7 +22,7 @@ class Projects::ApplyJoinService < ApplicationService
apply.forge_activities.find_or_create_by!(user: user, project: project) apply.forge_activities.find_or_create_by!(user: user, project: project)
notify_project_manager! notify_project_manager!(apply)
end end
# notify_project_owner # notify_project_owner
@ -47,10 +47,13 @@ class Projects::ApplyJoinService < ApplicationService
end end
end end
def notify_project_manager! def notify_project_manager!(apply)
columns = %i[user_id applied_id applied_type status viewed applied_user_id role project_id created_at updated_at] columns = %i[user_id applied_id applied_type status viewed applied_user_id role project_id created_at updated_at]
AppliedMessage.bulk_insert(*columns) do |worker| AppliedMessage.bulk_insert(*columns) do |worker|
base_attr = { status: false, viewed: false, applied_user_id: user.id, role: role_value, project_id: project.id } base_attr = {
applied_id: apply.id, applied_type: 'AppliedProject', status: false, viewed: false,
applied_user_id: user.id, role: role_value, project_id: project.id
}
project.manager_members.each do |manager| project.manager_members.each do |manager|
worker.add(base_attr.merge(user_id: manager.user_id)) worker.add(base_attr.merge(user_id: manager.user_id))

Loading…
Cancel
Save