]> git.openstreetmap.org Git - rails.git/blob - app/models/report.rb
Combine migrations into one
[rails.git] / app / models / report.rb
1 # == Schema Information
2 #
3 # Table name: reports
4 #
5 #  id               :integer          not null, primary key
6 #  issue_id         :integer
7 #  reporter_user_id :integer
8 #  details          :text             not null
9 #  created_at       :datetime         not null
10 #  updated_at       :datetime         not null
11 #
12 # Indexes
13 #
14 #  index_reports_on_issue_id          (issue_id)
15 #  index_reports_on_reporter_user_id  (reporter_user_id)
16 #
17 # Foreign Keys
18 #
19 #  reports_issue_id_fkey          (issue_id => issues.id) ON DELETE => cascade
20 #  reports_reporter_user_id_fkey  (reporter_user_id => users.id) ON DELETE => cascade
21 #
22
23 class Report < ActiveRecord::Base
24   belongs_to :issue, :counter_cache => true
25   belongs_to :user, :class_name => "User", :foreign_key => :reporter_user_id
26
27   validates :details, :presence => true
28 end