diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-17 14:06:55 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-18 05:46:45 +0200 |
commit | 4652489f40a4ff2b749f9ad495986a7a17448243 (patch) | |
tree | 90a373da8bdbaf66bc0228abf8465d9d928c9f2e /app/models/member.rb | |
parent | 00906b5bb6cde8cb60281109060a519a54000c61 (diff) | |
download | gitlab-ce-4652489f40a4ff2b749f9ad495986a7a17448243.tar.gz |
New Members::DestroyService
This is to ensure we don't send unwanted notifications when deleting a
project. In other words, stop abusing AR callbacks and use services.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 4ee3f1bb5c2..c74a16367db 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -48,7 +48,6 @@ class Member < ActiveRecord::Base after_create :post_create_hook, unless: [:pending?, :importing?] after_update :post_update_hook, unless: [:pending?, :importing?] after_destroy :post_destroy_hook, unless: :pending? - after_destroy :post_decline_request, if: :request? delegate :name, :username, :email, to: :user, prefix: true @@ -188,7 +187,7 @@ class Member < ActiveRecord::Base end def send_request - # override in subclass + notification_service.new_access_request(self) end def post_create_hook @@ -215,10 +214,6 @@ class Member < ActiveRecord::Base post_create_hook end - def post_decline_request - # override in subclass - end - def system_hook_service SystemHooksService.new end |