Class: Accessionable::Base::Tag::FieldSerializer
- Inherits:
-
Object
- Object
- Accessionable::Base::Tag::FieldSerializer
show all
- Defined in:
- app/models/accessionable/base.rb
Overview
Value serialization for accessioning XML generation
It will return the same value without any changes and it applies
to all tags
Constant Summary
collapse
- NOT_COLLECTED =
'not collected'
- NOT_PROVIDED =
'not provided'
- RESTRICTED_ACCESS =
'restricted access'
- NOT_APPLICABLE_CONTROL_SAMPLE =
'not applicable: control sample'
- NOT_APPLICABLE_SAMPLE_GROUP =
'not applicable: sample group'
- MISSING_SYNTHETIC_CONSTRUCT =
'missing: synthetic construct'
- MISSING_LAB_STOCK =
'missing: lab stock'
- MISING_THIRD_PARTY_DATA =
'missing: third party data'
- MISSING_DATA_AGGREEMENT_PRE2023 =
'missing: data agreement established pre-2023'
- MISSING_ENDANGERED_SPECIES =
'missing: endangered species'
- MISSING_HUMAN_IDENTIFIABLE =
'missing: human-identifiable'
- MISSING_CONTROL_SAMPLE =
'missing: control sample'
- MISSING_SAMPLE_GROUP =
'missing: sample group'
- OTHER_DEFAULT_SETTINGS =
[
NOT_COLLECTED,
NOT_PROVIDED,
RESTRICTED_ACCESS,
NOT_APPLICABLE_CONTROL_SAMPLE,
NOT_APPLICABLE_SAMPLE_GROUP,
MISSING_SYNTHETIC_CONSTRUCT,
MISSING_LAB_STOCK,
MISING_THIRD_PARTY_DATA,
MISSING_DATA_AGGREEMENT_PRE2023,
MISSING_ENDANGERED_SPECIES,
MISSING_HUMAN_IDENTIFIABLE,
MISSING_CONTROL_SAMPLE,
MISSING_SAMPLE_GROUP
].freeze
Instance Method Summary
collapse
Instance Method Details
#applies_to?(_name) ⇒ Boolean
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# File 'app/models/accessionable/base.rb', line 111
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# File 'app/models/accessionable/base.rb', line 115
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#value_for(value) ⇒ Object
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
# File 'app/models/accessionable/base.rb', line 107
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|