summaryrefslogtreecommitdiff
path: root/app/models/abuse_report.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-01-04 18:59:42 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-01-04 18:59:42 -0500
commit46a220ae3c0e646aac63a3230399fcc8979df6ec (patch)
treee58ef33e0afb682cc746220cdeebd0221173e93e /app/models/abuse_report.rb
parent01248d205103fe6c408e914e8943873ceb7acb2a (diff)
downloadgitlab-ce-46a220ae3c0e646aac63a3230399fcc8979df6ec.tar.gz
Add `AbuseReport#notify`rs-abuse-reports-refactor
Tell, Don't Ask.
Diffstat (limited to 'app/models/abuse_report.rb')
-rw-r--r--app/models/abuse_report.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb
index 89b3116b9f2..55864236b2f 100644
--- a/app/models/abuse_report.rb
+++ b/app/models/abuse_report.rb
@@ -18,4 +18,10 @@ class AbuseReport < ActiveRecord::Base
validates :user, presence: true
validates :message, presence: true
validates :user_id, uniqueness: true
+
+ def notify
+ return unless self.persisted?
+
+ AbuseReportMailer.notify(self.id).deliver_later
+ end
end