2019-05-08 13:49:43 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-06-23 15:19:08 +02:00
|
|
|
class SampleCustomField < ApplicationRecord
|
2017-04-11 14:55:44 +02:00
|
|
|
include SearchableModel
|
|
|
|
|
2016-09-21 15:35:23 +02:00
|
|
|
auto_strip_attributes :value, nullify: false
|
2019-05-08 13:49:43 +02:00
|
|
|
validates :value, presence: true, length: { maximum: Constants::NAME_MAX_LENGTH }
|
2016-02-12 16:52:43 +01:00
|
|
|
validates :custom_field, :sample, presence: true
|
|
|
|
|
2019-05-08 13:49:43 +02:00
|
|
|
belongs_to :custom_field, inverse_of: :sample_custom_fields
|
|
|
|
belongs_to :sample, inverse_of: :sample_custom_fields
|
2016-02-12 16:52:43 +01:00
|
|
|
end
|