mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Merge pull request #786 from mlorb/ml-sci-1587
Fix bugs with importing samples [SCI-1587]
This commit is contained in:
commit
03743a21f6
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<% if th.nil? %>
|
||||
<i><%= t('samples.modal_import.no_header_name') %></i>
|
||||
<% else %>
|
||||
<% if th.length > Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>
|
||||
<% if th.to_s.length > Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>
|
||||
<div class="modal-tooltip">
|
||||
<%= truncate(th, length: Constants::NAME_TRUNCATION_LENGTH_DROPDOWN) %>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue