|
|
|
@ -22,7 +22,7 @@ class Projects::ApplyJoinService < ApplicationService
|
|
|
|
|
|
|
|
|
|
apply.forge_activities.find_or_create_by!(user: user, project: project)
|
|
|
|
|
|
|
|
|
|
notify_project_manager!
|
|
|
|
|
notify_project_manager!(apply)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# notify_project_owner
|
|
|
|
@ -47,10 +47,13 @@ class Projects::ApplyJoinService < ApplicationService
|
|
|
|
|
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]
|
|
|
|
|
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|
|
|
|
|
|
worker.add(base_attr.merge(user_id: manager.user_id))
|
|
|
|
|