From 3f0b690d8f0011dfdcc32af2626eef473f9111b5 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 21 Feb 2009 12:29:30 +0100 Subject: updated the importer to set the published_at date properly --- lib/update_importer.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/update_importer.rb') diff --git a/lib/update_importer.rb b/lib/update_importer.rb index 0aa0dcc..1fcf40e 100644 --- a/lib/update_importer.rb +++ b/lib/update_importer.rb @@ -84,8 +84,7 @@ class UpdateImporter page = node.pages.create!( :title => xhtml.elements['title'].get_text.to_s, :abstract => xhtml.elements['abstract'].get_text.to_s, - :body => body, - :published_at => date + :body => body ) else page = node.pages.first @@ -98,9 +97,13 @@ class UpdateImporter :body => body ) - page.save end + page.published_at = date.to_time + page.save! + + puts page.published_at + page.tag_list.add("update") if page if (flags = xhtml.elements['flags']) && page @@ -110,7 +113,6 @@ class UpdateImporter end if node.head.nil? && page - puts page.title node.head = page node.save! end -- cgit v1.3