forked from saurabh/personal-journal
small fix for types and stuff
This commit is contained in:
parent
b4011a8ada
commit
e883a9cae5
|
@ -80,16 +80,16 @@ module Admin::JournalPapersHelper
|
|||
when 12
|
||||
jp.total_pages = val
|
||||
when 13
|
||||
jls = JournalLevel.all.to_a
|
||||
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
|
||||
end
|
||||
when 14
|
||||
jpts = JournalPaperType.all.to_a
|
||||
jpts = JournalPaperType.asc(:created_at).all.to_a
|
||||
jp.journal_paper_type = jpts[val.to_i]
|
||||
when 15
|
||||
jpas = JournalPaperAuthorType.all.to_a
|
||||
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
|
||||
|
|
|
@ -60,7 +60,7 @@ wb.add_worksheet(name: "Journal Paper") do |sheet|
|
|||
row1 << "checkbox"
|
||||
t = ""
|
||||
keys = []
|
||||
JournalLevel.each_with_index do |jl,i|
|
||||
JournalLevel.asc(:created_at).each_with_index do |jl,i|
|
||||
t = t + "#{i}" + " -> " + jl.title + ", "
|
||||
end
|
||||
if JournalLevel.count > 0
|
||||
|
@ -74,7 +74,7 @@ wb.add_worksheet(name: "Journal Paper") do |sheet|
|
|||
row1 << "select"
|
||||
t = ""
|
||||
keys = []
|
||||
JournalPaperType.each_with_index do |jl,i|
|
||||
JournalPaperType.asc(:created_at).each_with_index do |jl,i|
|
||||
t = t + "#{i}" + " -> " + jl.title + ", "
|
||||
end
|
||||
if JournalPaperType.count > 0
|
||||
|
@ -88,7 +88,7 @@ wb.add_worksheet(name: "Journal Paper") do |sheet|
|
|||
row1 << "checkbox"
|
||||
t = ""
|
||||
keys = []
|
||||
JournalPaperAuthorType.each_with_index do |jl,i|
|
||||
JournalPaperAuthorType.asc(:created_at).each_with_index do |jl,i|
|
||||
t = t + "#{i}" + " -> " + jl.title + ", "
|
||||
end
|
||||
if JournalPaperAuthorType.count > 0
|
||||
|
|
Loading…
Reference in New Issue