Class: Metadata::Base
Direct Known Subclasses
CherrypickForFluidigmRequest::Metadata, ElementAvitiSequencingRequest::Metadata, LibraryCreationRequest::Metadata, Metadata, PacBioLibraryTube::Metadata, PacBioSamplePrepRequest::Metadata, PacBioSequencingRequest::Metadata, PbmcPoolingCustomerRequest::Metadata, Project::Metadata, Request::LibraryCreation::Metadata, Request::Traction::GridIon::Metadata, SequencingRequest::Metadata, UltimaSequencingRequest::Metadata, UltimaUG200SequencingRequest::Metadata
Class Method Summary
collapse
Instance Method Summary
collapse
#association_value_pairs, #attribute_details_for, #attribute_value_pairs, #field_infos, included, #instance_defaults, #required?
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
extended
Constructor Details
#initialize(attributes = {}) ⇒ Base
This ensures that the default values are stored within the DB, meaning that this information will be
preserved for the future, unlike the original properties information which didn't store values when
nil which lead to us having to guess.
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# File 'app/models/metadata.rb', line 92
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
|
Class Method Details
.localised_sections(field) ⇒ Object
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# File 'app/models/metadata.rb', line 142
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
|
.localised_sections_generator(field) ⇒ Object
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# File 'app/models/metadata.rb', line 128
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
|
.localised_sections_store ⇒ Object
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
# File 'app/models/metadata.rb', line 124
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
|
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# File 'app/models/metadata.rb', line 120
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
|
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
# File 'app/models/metadata.rb', line 116
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
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'app/models/metadata.rb', line 112
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
|
Instance Method Details
#merge_instance_defaults ⇒ Object
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# File 'app/models/metadata.rb', line 98
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
|