Skip to content

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 in Key, but then we override notify_user to do nothing in DeployKey! :P

    Ideally, this should definitely go into a DeployKeys::CreateService.

Edited by haseeb