From 0264081c08df3dd6a15aa1e1bde2b291945aefef Mon Sep 17 00:00:00 2001 From: Coleman Date: Fri, 27 Jun 2008 01:49:11 -0500 Subject: [PATCH] add page id to comments on import --- bin/import_drupal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/import_drupal.rb b/bin/import_drupal.rb index 951b84c..e19b478 100755 --- a/bin/import_drupal.rb +++ b/bin/import_drupal.rb @@ -63,7 +63,7 @@ pages.each do |p| next unless comment['nid'].to_i == p.nid.to_i c2 = Time.now c2 -= (c2.to_i - comment['timestamp'].to_i).seconds - c = Comment.create(:comment => comment['comment'], :user => comment['name'], :url => comment['homepage'], :created_at => c2) + c = Comment.create(:comment => comment['comment'], :user => comment['name'], :url => comment['homepage'], :created_at => c2, :page_id => p.id) if c.new_record? \$stderr.puts "FAILED TO SAVE COMMENT ON PAGE #{p.id} NODE #{p.nid}" c.errors.each_full { |msg| \$stderr.puts "* #{msg}" }