discourse/app/models/post_reply.rb

21 lines
393 B
Ruby
Raw Normal View History

class PostReply < ActiveRecord::Base
belongs_to :post
belongs_to :reply, class_name: 'Post'
validates_uniqueness_of :reply_id, scope: :post_id
end
2013-05-24 10:35:14 +08:00
# == Schema Information
#
# Table name: post_replies
#
# post_id :integer
# reply_id :integer
2014-04-08 23:35:44 +08:00
# created_at :datetime
# updated_at :datetime
2013-05-24 10:35:14 +08:00
#
# Indexes
#
# index_post_replies_on_post_id_and_reply_id (post_id,reply_id) UNIQUE
#