Make DeployKeys::CreateService and so on to create keys
We should make DeployKeys::CreateService
to create deploy keys, and send the notifications there, rather than using the hook to send the notifications.
The following discussion from !13257 (merged) should be addressed:
-
@rymai started a discussion: (+1 comment) Not related to the changes in this MR: This screams "code-smell" at me, in the sense that why would we send emails from a model? :) Also, what's "funny" is that we have
after_commit :notify_user, on: :create
inKey
, but then we overridenotify_user
to do nothing inDeployKey
! :PIdeally, this should definitely go into a
DeployKeys::CreateService
.
Edited by username-removed-1495853