Guest User

Untitled

a guest
Apr 26th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Comment.find(:all).select {|c| c.body.include?("[...]")}.each do |comment|
  2. t = Trackback.new(:url => comment.url, :title => comment.author, :excerpt => comment.body)
  3. t.save
  4. t.article = comment.article
  5. t.created_at = comment.created_at
  6. t.save
  7. end
  8.  
  9. # We're converting an existing blog, so everything in there is ham
  10. Feedback.find(:all).each { |f| f.mark_as_ham! }
  11.  
  12. # Destroy the old comments
  13. Comment.find(:all).select {|c| c.body.include?("[...]")}.each { |c| c.destroy }
Add Comment
Please, Sign In to add comment