mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
12 lines
432 B
Ruby
12 lines
432 B
Ruby
class SampleCustomField < ApplicationRecord
|
|
include SearchableModel
|
|
|
|
auto_strip_attributes :value, nullify: false
|
|
validates :value,
|
|
presence: true,
|
|
length: { maximum: Constants::NAME_MAX_LENGTH }
|
|
validates :custom_field, :sample, presence: true
|
|
|
|
belongs_to :custom_field, inverse_of: :sample_custom_fields, optional: true
|
|
belongs_to :sample, inverse_of: :sample_custom_fields, optional: true
|
|
end
|