Skip to content

Commit

Permalink
Update genome.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
lmrodriguezr committed Jan 7, 2024
1 parent 338c2f3 commit e9f2823
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/genome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,14 @@ def source_attributes
return unless source_hash
return @source_attributes if @source_attributes

not_provided = ['not provided', 'unavailable', 'missing']
@source_attributes = {}
source_hash[:samples].each_value do |sample|
sample[:attributes].each do |key, value|
value.strip!
nice_key = key.to_s.downcase.gsub(/[^A-Za-z0-9]/, '_')
.gsub(/_+/, '_').gsub(/^_|_$/, '').to_sym
if value.present?
if value.present? && !not_provided.include?(value.downcase)
@source_attributes[nice_key] ||= []
@source_attributes[nice_key] << value
end
Expand Down

0 comments on commit e9f2823

Please sign in to comment.