mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-19 07:32:34 +08:00
8 lines
253 B
Ruby
8 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
|