scinote-web/app/models/sample_comment.rb
2016-02-12 16:52:43 +01:00

7 lines
253 B
Ruby

class SampleComment < ActiveRecord::Base
validates :comment, :sample, presence: true
validates :sample_id, uniqueness: { scope: :comment_id }
belongs_to :comment, inverse_of: :sample_comment
belongs_to :sample, inverse_of: :sample_comments
end