Class: DataReleaseStudyType

Inherits:
ApplicationRecord show all
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 <ArrayExpress> tag is added to the study accession

  • Determines the list of valid delay reasons

See Also:

Defined Under Namespace

Modules: Associations

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Attributable::Association::Target

default, extended, for_select_association

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Attribute Details

#for_array_expressBoolean

Determines if the study needs an ArrayExpress accession number and adds an <ArrayExpress> tag to the study.xml. (This used to trigger generation of an ArrayExpress accession, but I'm not sure this is still the case)

Returns:

  • (Boolean)

    True if the associated study needs ArrayExpress accession numbers


31
# File 'app/models/data_release_study_type.rb', line 31

has_many :study

#is_assay_typeBoolean

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

Returns:

  • (Boolean)

    True if 'assay of no other use' is a valid delay reason


31
# File 'app/models/data_release_study_type.rb', line 31

has_many :study

#is_defaultBoolean

Should be true for single option, sets it as the default DataReleaseStudyType

Returns:

  • (Boolean)

    True if a default, false otherwise


31
# File 'app/models/data_release_study_type.rb', line 31

has_many :study

Class Method Details

.defaultDataReleaseStudyType

Returns the default DataReleaseStudyType according to the is_default flag.

Returns:


44
45
46
# File 'app/models/data_release_study_type.rb', line 44

def self.default
  find_by(is_default: true)
end