small fix for import for journal_paper

This commit is contained in:
Harry Bomrah 2015-12-14 15:17:28 +08:00
parent 4af43b8905
commit 3091fc2aa2
1 changed files with 3 additions and 3 deletions

View File

@ -83,16 +83,16 @@ module Admin::JournalPapersHelper
jls = JournalLevel.asc(:created_at).all.to_a
ts = val.to_s.split(",")
ts.each do |t|
jp.journal_level_ids << jls[t.to_i].id if t.is_i? && t.to_i < jls.count
jp.journal_level_ids << jls[t.to_i].id if t.to_s.is_i? && t.to_i < jls.count
end
when 14
jpts = JournalPaperType.asc(:created_at).all.to_a
jp.journal_paper_type = jpts[val.to_i] if val.is_i? && val.to_i < jpts.count
jp.journal_paper_type = jpts[val.to_i] if val.is_i? && val.to_s.to_i < jpts.count
when 15
jpas = JournalPaperAuthorType.asc(:created_at).all.to_a
ts = val.to_s.split(",")
ts.each do |t|
jp.journal_paper_author_type_ids << jpas[t.to_i].id if t.is_i? && t.to_i < jpas.count
jp.journal_paper_author_type_ids << jpas[t.to_i].id if t.to_s.is_i? && t.to_i < jpas.count
end
when 16
jp.number_of_authors = val