Not sure what the diff is here, but it seems to work now

This commit is contained in:
Will Bradley 2014-03-06 17:37:38 -07:00
parent d4b2457787
commit 4b36eaeccf

View File

@ -52,6 +52,7 @@ module WordPressImport
p message p message
$ATTACHMENT_EXCEPTIONS = [] if $ATTACHMENT_EXCEPTIONS.blank? $ATTACHMENT_EXCEPTIONS = [] if $ATTACHMENT_EXCEPTIONS.blank?
$ATTACHMENT_EXCEPTIONS << message $ATTACHMENT_EXCEPTIONS << message
return nil
end end
end end
@ -115,6 +116,7 @@ module WordPressImport
file file
end end
def replace_image_url def replace_image_url
replace_image_url_in_blog_posts replace_image_url_in_blog_posts
replace_image_url_in_pages replace_image_url_in_pages
@ -143,8 +145,7 @@ module WordPressImport
def replace_url_in_blog_posts(new_url) def replace_url_in_blog_posts(new_url)
::Post.all.each do |post| ::Post.all.each do |post|
byebug if post.id == 168 if (! post.body.empty?) && post.body.include?(url)
if ((! post.body.empty?) && post.body.include?(url))
@occurrance_count++ @occurrance_count++
post.body = post.body.gsub(url_pattern, new_url) post.body = post.body.gsub(url_pattern, new_url)
post.save! post.save!