summaryrefslogtreecommitdiff
path: root/app/models/spam_log.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-01-26 19:20:01 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-02 11:25:44 -0200
commit718b1dddfe8d7422e8de8b2fbbd8357fc1c3b5e4 (patch)
tree13950c0ea38a77ff198e038ce32a093801f99a06 /app/models/spam_log.rb
parenta2bbf004779db402e67a918db893c166502f5050 (diff)
downloadgitlab-ce-718b1dddfe8d7422e8de8b2fbbd8357fc1c3b5e4.tar.gz
Refactor Admin::SpamLogsController to block user before destroying
Diffstat (limited to 'app/models/spam_log.rb')
-rw-r--r--app/models/spam_log.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/spam_log.rb b/app/models/spam_log.rb
index b7b32b478a7..12df68ef83b 100644
--- a/app/models/spam_log.rb
+++ b/app/models/spam_log.rb
@@ -2,4 +2,9 @@ class SpamLog < ActiveRecord::Base
belongs_to :user
validates :user, presence: true
+
+ def remove_user
+ user.block
+ user.destroy
+ end
end