-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
142 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
class IsaTag < ApplicationRecord | ||
class ISATag < ApplicationRecord | ||
validates :title, presence: true | ||
|
||
has_many :template_attributes, inverse_of: :isa_tag | ||
has_many :sample_attributes, inverse_of: :isa_tag | ||
has_many :template_attributes, inverse_of: :ISATag | ||
has_many :sample_attributes, inverse_of: :ISATag | ||
|
||
def isa_source? | ||
title == Seek::Isa::TagType::SOURCE | ||
title == Seek::ISA::TagType::SOURCE | ||
end | ||
|
||
def isa_source_characteristic? | ||
title == Seek::Isa::TagType::SOURCE_CHARACTERISTIC | ||
title == Seek::ISA::TagType::SOURCE_CHARACTERISTIC | ||
end | ||
|
||
def isa_sample? | ||
title == Seek::Isa::TagType::SAMPLE | ||
title == Seek::ISA::TagType::SAMPLE | ||
end | ||
|
||
def isa_sample_characteristic? | ||
title == Seek::Isa::TagType::SAMPLE_CHARACTERISTIC | ||
title == Seek::ISA::TagType::SAMPLE_CHARACTERISTIC | ||
end | ||
|
||
def isa_protocol? | ||
title == Seek::Isa::TagType::PROTOCOL | ||
title == Seek::ISA::TagType::PROTOCOL | ||
end | ||
|
||
def isa_other_material? | ||
title == Seek::Isa::TagType::OTHER_MATERIAL | ||
title == Seek::ISA::TagType::OTHER_MATERIAL | ||
end | ||
|
||
def isa_other_material_characteristic? | ||
title == Seek::Isa::TagType::OTHER_MATERIAL_CHARACTERISTIC | ||
title == Seek::ISA::TagType::OTHER_MATERIAL_CHARACTERISTIC | ||
end | ||
|
||
def isa_data_file? | ||
title == Seek::Isa::TagType::DATA_FILE | ||
title == Seek::ISA::TagType::DATA_FILE | ||
end | ||
|
||
def isa_data_file_comment? | ||
title == Seek::Isa::TagType::DATA_FILE_COMMENT | ||
title == Seek::ISA::TagType::DATA_FILE_COMMENT | ||
end | ||
|
||
def isa_parameter_value? | ||
title == Seek::Isa::TagType::PARAMETER_VALUE | ||
title == Seek::ISA::TagType::PARAMETER_VALUE | ||
end | ||
|
||
def self.allowed_isa_tags_for_level(level) | ||
tags = case level | ||
when 'study source' | ||
Seek::Isa::TagType::SOURCE_TAGS | ||
Seek::ISA::TagType::SOURCE_TAGS | ||
when 'study sample' | ||
Seek::Isa::TagType::SAMPLE_TAGS | ||
Seek::ISA::TagType::SAMPLE_TAGS | ||
when 'assay - material' | ||
Seek::Isa::TagType::OTHER_MATERIAL_TAGS | ||
Seek::ISA::TagType::OTHER_MATERIAL_TAGS | ||
when 'assay - data file' | ||
Seek::Isa::TagType::DATA_FILE_TAGS | ||
Seek::ISA::TagType::DATA_FILE_TAGS | ||
else | ||
Seek::Isa::TagType::ALL_TYPES | ||
Seek::ISA::TagType::ALL_TYPES | ||
end | ||
|
||
tags.map { |tag| IsaTag.find_by(title: tag) } | ||
tags.map { |tag| ISATag.find_by(title: tag) } | ||
end | ||
end |
Oops, something went wrong.