summaryrefslogtreecommitdiff
path: root/app/models/spam_log.rb
blob: f49eb7d88e20e3a4ab3d57be4e517d7ada78bfb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# == Schema Information
#
# Table name: spam_logs
#
#  id            :integer          not null, primary key
#  user_id       :integer
#  source_ip     :string
#  user_agent    :string
#  via_api       :boolean
#  project_id    :integer
#  noteable_type :string
#  title         :string
#  description   :text
#  created_at    :datetime         not null
#  updated_at    :datetime         not null
#

class SpamLog < ActiveRecord::Base
  belongs_to :user

  validates :user, presence: true

  def remove_user
    user.block
    user.destroy
  end
end