Skip to content

Commit

Permalink
update Resource seeds requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneHaensel committed Jul 10, 2024
1 parent 75a6916 commit 1abfc99
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions db/seeds/018_MDS_3_3_Project_gen.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_classification_Project', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_classification_Project', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_type_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_classification_type_Project_cv, description:'A term describing the resource.', label:'Type of the resource(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_type_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_classification_type_Project_cv, description:'A term describing the resource.', label:'Type of the resource',required: true)
emt.save!
end

Expand All @@ -482,8 +482,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_titles_Project', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_titles_Project', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_text_Project', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Scientific unabbreviated title or name of the Project. ', label: 'Title/name(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_language_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_titles_language_Project_cv, description:'Language in which the title/name is provided.', label:'Language of the title/name(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_text_Project', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Scientific unabbreviated title or name of the Project. ', label: 'Title/name',required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_language_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_titles_language_Project_cv, description:'Language in which the title/name is provided.', label:'Language of the title/name',required: true)
emt.save!
end

Expand All @@ -494,8 +494,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_acronyms_Project', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_acronyms_Project', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_text_Project', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'If existing, acronym(s) of the Project.', label: 'Acronym(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_language_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_acronyms_language_Project_cv, description:'Language in which the acronym is provided.', label:'Language of the acronym(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_text_Project', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'If existing, acronym(s) of the Project.', label: 'Acronym',required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_language_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_acronyms_language_Project_cv, description:'Language in which the acronym is provided.', label:'Language of the acronym',required: true)
emt.save!
end

Expand All @@ -506,8 +506,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_descriptions_Project', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_descriptions_Project', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_text_Project', sample_attribute_type: @text_type, sample_controlled_vocab: nil, description: 'Short plain text summary of the Project.', label: 'Description(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_language_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_descriptions_language_Project_cv, description:'Language in which the description text is provided.', label:'Language of the description(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_text_Project', sample_attribute_type: @text_type, sample_controlled_vocab: nil, description: 'Short plain text summary of the Project.', label: 'Description',required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_language_Project', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_descriptions_language_Project_cv, description:'Language in which the description text is provided.', label:'Language of the description',required: true)
emt.save!
end

Expand Down
14 changes: 7 additions & 7 deletions db/seeds/019_MDS_3_3_Study_gen.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_classification_Study', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_classification_Study', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_type_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_classification_type_Study_cv, description:'A term describing the resource.', label:'Type of the resource(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_type_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_classification_type_Study_cv, description:'A term describing the resource.', label:'Type of the resource', required: true)
emt.save!
end

Expand All @@ -482,8 +482,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_titles_Study', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_titles_Study', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_text_Study', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Scientific unabbreviated title or name of the Study. ', label: 'Title/name(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_language_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_titles_language_Study_cv, description:'Language in which the title/name is provided.', label:'Language of the title/name(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_text_Study', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Scientific unabbreviated title or name of the Study. ', label: 'Title/name',required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_language_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_titles_language_Study_cv, description:'Language in which the title/name is provided.', label:'Language of the title/name',required: true)
emt.save!
end

Expand All @@ -494,8 +494,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_acronyms_Study', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_acronyms_Study', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_text_Study', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'If existing, acronym(s) of the Study.', label: 'Acronym(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_language_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_acronyms_language_Study_cv, description:'Language in which the acronym is provided.', label:'Language of the acronym(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_text_Study', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'If existing, acronym(s) of the Study.', label: 'Acronym',required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_language_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_acronyms_language_Study_cv, description:'Language in which the acronym is provided.', label:'Language of the acronym',required: true)
emt.save!
end

Expand All @@ -506,8 +506,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_descriptions_Study', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_descriptions_Study', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_text_Study', sample_attribute_type: @text_type, sample_controlled_vocab: nil, description: 'Short plain text summary of the Study.', label: 'Description(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_language_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_descriptions_language_Study_cv, description:'Language in which the description text is provided.', label:'Language of the description(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_text_Study', sample_attribute_type: @text_type, sample_controlled_vocab: nil, description: 'Short plain text summary of the Study.', label: 'Description', required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_language_Study', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_descriptions_language_Study_cv, description:'Language in which the description text is provided.', label:'Language of the description', required: true)
emt.save!
end

Expand Down
14 changes: 7 additions & 7 deletions db/seeds/020_MDS_3_3_Investigation_gen.seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_classification_Investigation', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_classification_Investigation', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_type_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_classification_type_Investigation_cv, description:'A term describing the resource.', label:'Type of the resource(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_classification_type_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_classification_type_Investigation_cv, description:'A term describing the resource.', label:'Type of the resource', required: true)
emt.save!
end

Expand All @@ -482,8 +482,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_titles_Investigation', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_titles_Investigation', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_text_Investigation', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Scientific unabbreviated title or name of the Investigation. ', label: 'Title/name(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_language_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_titles_language_Investigation_cv, description:'Language in which the title/name is provided.', label:'Language of the title/name(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_text_Investigation', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'Scientific unabbreviated title or name of the Investigation. ', label: 'Title/name', required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_titles_language_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_titles_language_Investigation_cv, description:'Language in which the title/name is provided.', label:'Language of the title/name', required: true)
emt.save!
end

Expand All @@ -494,8 +494,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_acronyms_Investigation', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_acronyms_Investigation', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_text_Investigation', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'If existing, acronym(s) of the Investigation.', label: 'Acronym(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_language_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_acronyms_language_Investigation_cv, description:'Language in which the acronym is provided.', label:'Language of the acronym(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_text_Investigation', sample_attribute_type: @string_type, sample_controlled_vocab: nil, description: 'If existing, acronym(s) of the Investigation.', label: 'Acronym', required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_acronyms_language_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_acronyms_language_Investigation_cv, description:'Language in which the acronym is provided.', label:'Language of the acronym', required: true)
emt.save!
end

Expand All @@ -506,8 +506,8 @@ def create_sample_controlled_vocab_terms_attributes(array)

unless ExtendedMetadataType.where(title:'Resource_descriptions_Investigation', supported_type:'ExtendedMetadata').any?
emt = ExtendedMetadataType.new(title: 'Resource_descriptions_Investigation', supported_type:'ExtendedMetadata')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_text_Investigation', sample_attribute_type: @text_type, sample_controlled_vocab: nil, description: 'Short plain text summary of the Investigation.', label: 'Description(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_language_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_descriptions_language_Investigation_cv, description:'Language in which the description text is provided.', label:'Language of the description(*)')
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_text_Investigation', sample_attribute_type: @text_type, sample_controlled_vocab: nil, description: 'Short plain text summary of the Investigation.', label: 'Description', required: true)
emt.extended_metadata_attributes << ExtendedMetadataAttribute.new(title: 'Resource_descriptions_language_Investigation', sample_attribute_type: @cv_type, sample_controlled_vocab:Resource_descriptions_language_Investigation_cv, description:'Language in which the description text is provided.', label:'Language of the description', required: true)
emt.save!
end

Expand Down

0 comments on commit 1abfc99

Please sign in to comment.