2015-09-06 10:48:48 -04:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: abuse_reports
|
|
|
|
#
|
|
|
|
# id :integer not null, primary key
|
|
|
|
# reporter_id :integer
|
|
|
|
# user_id :integer
|
|
|
|
# message :text
|
|
|
|
# created_at :datetime
|
|
|
|
# updated_at :datetime
|
|
|
|
#
|
|
|
|
|
2015-08-06 08:03:27 -04:00
|
|
|
class AbuseReport < ActiveRecord::Base
|
2015-09-29 12:08:55 -04:00
|
|
|
belongs_to :reporter, class_name: 'User'
|
2015-08-06 08:03:27 -04:00
|
|
|
belongs_to :user
|
|
|
|
|
|
|
|
validates :reporter, presence: true
|
|
|
|
validates :user, presence: true
|
|
|
|
validates :message, presence: true
|
2015-09-29 12:08:55 -04:00
|
|
|
validates :user_id, uniqueness: true
|
2015-08-06 08:03:27 -04:00
|
|
|
end
|