mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 06:23:39 +08:00
21 lines
393 B
Ruby
21 lines
393 B
Ruby
class PostReply < ActiveRecord::Base
|
|
belongs_to :post
|
|
belongs_to :reply, class_name: 'Post'
|
|
|
|
validates_uniqueness_of :reply_id, scope: :post_id
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: post_replies
|
|
#
|
|
# post_id :integer
|
|
# reply_id :integer
|
|
# created_at :datetime
|
|
# updated_at :datetime
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_post_replies_on_post_id_and_reply_id (post_id,reply_id) UNIQUE
|
|
#
|