diff --git a/app/models/team.rb b/app/models/team.rb index 72164fcf9..04a45375a 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -106,7 +106,7 @@ class Team < ActiveRecord::Base sheet.row(i).each.with_index do |value, index| if index == stype_index - stype = SampleType.where(name: value, team: self).take + stype = SampleType.where(name: value.strip, team: self).take unless stype stype = SampleType.new(name: value, team: self) @@ -117,7 +117,7 @@ class Team < ActiveRecord::Base end sample.sample_type = stype elsif index == sgroup_index - sgroup = SampleGroup.where(name: value, team: self).take + sgroup = SampleGroup.where(name: value.strip, team: self).take unless sgroup sgroup = SampleGroup.new(name: value, team: self) diff --git a/app/views/samples/_parse_samples_modal.html.erb b/app/views/samples/_parse_samples_modal.html.erb index 613c3d444..3e48a3f3c 100644 --- a/app/views/samples/_parse_samples_modal.html.erb +++ b/app/views/samples/_parse_samples_modal.html.erb @@ -28,7 +28,7 @@ <% if th.nil? %> <%= t('samples.modal_import.no_header_name') %> <% else %> - <% if th.length > Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %> + <% if th.to_s.length > Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>