Class: DataReleaseStudyType
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- DataReleaseStudyType
- Extended by:
- Attributable::Association::Target
- Defined in:
- app/models/data_release_study_type.rb
Overview
On Study creation the user selects a DataReleaseStudyType from a drop down list of pre-registered data release study types. The default option is determined by the #is_default flag in the database
This information is exposed:
- In the warehouses, where it may be used by customers, NPG, or bioinformaticians
- Via the V1 API. (Not aware of any uses here, but there may be)
It drives specific behaviours:
- Shows the array express accession field on study edit page if #for_array_express is true
- Determines if the
tag is added to the study accession - Determines the list of valid delay reasons
Defined Under Namespace
Modules: Associations
Instance Attribute Summary collapse
-
#for_array_express ⇒ Boolean
Determines if the study needs an ArrayExpress accession number and adds an
tag to the study.xml. -
#is_assay_type ⇒ Boolean
Controls whether 'assay of no other use' as acceptable reason for a delay in data-release in app/views/shared/metadata/edit/_study.html.erb.
-
#is_default ⇒ Boolean
Should be true for single option, sets it as the default DataReleaseStudyType.
Class Method Summary collapse
-
.default ⇒ DataReleaseStudyType
Returns the default DataReleaseStudyType according to the is_default flag.
Methods included from Attributable::Association::Target
default, extended, for_select_association
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Attribute Details
#for_array_express ⇒ Boolean
Determines if the study needs an ArrayExpress accession number and adds an
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/models/data_release_study_type.rb', line 32 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. 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 |
#is_assay_type ⇒ Boolean
Controls whether 'assay of no other use' as acceptable reason for a delay in data-release in app/views/shared/metadata/edit/_study.html.erb
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/models/data_release_study_type.rb', line 32 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. 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 |
#is_default ⇒ Boolean
Should be true for single option, sets it as the default DataReleaseStudyType
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/models/data_release_study_type.rb', line 32 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. 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
.default ⇒ DataReleaseStudyType
Returns the default DataReleaseStudyType according to the is_default flag.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'app/models/data_release_study_type.rb', line 48 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. 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 |