scinote-web/app/models/result_comment.rb

9 lines
266 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
class ResultComment < ActiveRecord::Base
validates :result, :comment, presence: true
validates :result_id, uniqueness: { scope: :comment_id }
belongs_to :result, inverse_of: :result_comments
belongs_to :comment,
2016-08-25 19:59:50 +08:00
inverse_of: :result_comment
2016-02-12 23:52:43 +08:00
end