scinote-web/app/models/result_comment.rb

8 lines
253 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, inverse_of: :result_comment
2016-02-12 23:52:43 +08:00
end