Update fgu_sync.rake.
This commit is contained in:
parent
9e937f6ca5
commit
c1483b27bf
|
@ -74,7 +74,7 @@ namespace :fgu_sync do
|
||||||
|
|
||||||
jp = JournalPaper.where(:rss2_id => rss2id).first rescue nil
|
jp = JournalPaper.where(:rss2_id => rss2id).first rescue nil
|
||||||
jp_data = {
|
jp_data = {
|
||||||
:publication_date => pd, :rss2_id => rss2id, :year => pd.strftime("%Y"),
|
:publication_date => pd, :rss2_id => rss2id, :year => (pd ? pd.strftime("%Y") : ""),
|
||||||
:authors_translations => authors, :paper_title_translations => paper_title,
|
:authors_translations => authors, :paper_title_translations => paper_title,
|
||||||
:journal_title_translations => journal_title, :vol_no => dt["vol_no"], :issue_no => dt["issue_no"],
|
:journal_title_translations => journal_title, :vol_no => dt["vol_no"], :issue_no => dt["issue_no"],
|
||||||
:note => note, :form_to_start => from_to[0], :form_to_end => from_to[1]
|
:note => note, :form_to_start => from_to[0], :form_to_end => from_to[1]
|
||||||
|
@ -121,7 +121,7 @@ namespace :fgu_sync do
|
||||||
note = dt["department"] + " " + dt["note"]
|
note = dt["department"] + " " + dt["note"]
|
||||||
|
|
||||||
cp = WritingConference.where(:rss2_id => rss2id).first rescue nil
|
cp = WritingConference.where(:rss2_id => rss2id).first rescue nil
|
||||||
cp_data = {:period_start_date => start_date, :period_end_date => end_date, :rss2_id => rss2id, :year => end_date.strftime("%Y"), :authors_translations => authors, :paper_title_translations => paper_title, :conference_title_translations => conference_title, :note => note, :location_translations => {"en" => dt["location"], "zh_tw" => dt["location"]}}
|
cp_data = {:period_start_date => start_date, :period_end_date => end_date, :rss2_id => rss2id, :year => (end_date ? end_date.strftime("%Y") : ""), :authors_translations => authors, :paper_title_translations => paper_title, :conference_title_translations => conference_title, :note => note, :location_translations => {"en" => dt["location"], "zh_tw" => dt["location"]}}
|
||||||
if cp.nil?
|
if cp.nil?
|
||||||
cp = WritingConference.new(cp_data)
|
cp = WritingConference.new(cp_data)
|
||||||
puts "Saving new conference."
|
puts "Saving new conference."
|
||||||
|
@ -174,7 +174,7 @@ namespace :fgu_sync do
|
||||||
end
|
end
|
||||||
|
|
||||||
book = Book.where(:rss2_id => rss2id).first rescue nil
|
book = Book.where(:rss2_id => rss2id).first rescue nil
|
||||||
book_data = {:publish_date => pd, :rss2_id => rss2id, :year => pd.strftime("%Y"), :authors_translations => authors, :publisher_translations => publisher, :book_title_translations => book_title, :isbn => dt["isbn"], :note => note, :language => dt["language"], :member_profile => mp}
|
book_data = {:publish_date => pd, :rss2_id => rss2id, :year => (pd ? pd.strftime("%Y") : ""), :authors_translations => authors, :publisher_translations => publisher, :book_title_translations => book_title, :isbn => dt["isbn"], :note => note, :language => dt["language"], :member_profile => mp}
|
||||||
if book.nil?
|
if book.nil?
|
||||||
book = Book.new(book_data)
|
book = Book.new(book_data)
|
||||||
puts "Saving new book."
|
puts "Saving new book."
|
||||||
|
|
Loading…
Reference in New Issue