openstreetmap-website/app/models/issue_comment.rb
Andy Allan 1956ab5913 Use a simple user_id for tables with one owning user
This is the standard way of naming in rails, and it avoids having
to tell rails which models are actually required.
2017-11-29 16:23:13 +00:00

30 lines
797 B
Ruby

# == Schema Information
#
# Table name: issue_comments
#
# id :integer not null, primary key
# issue_id :integer not null
# user_id :integer not null
# body :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_issue_comments_on_issue_id (issue_id)
# index_issue_comments_on_user_id (user_id)
#
# Foreign Keys
#
# issue_comments_issue_id_fkey (issue_id => issues.id) ON DELETE => cascade
# issue_comments_user_id (user_id => users.id) ON DELETE => cascade
#
class IssueComment < ActiveRecord::Base
belongs_to :issue
belongs_to :user
validates :body, :presence => true
validates :user, :presence => true
validates :issue, :presence => true
end