diff --git a/lib/tasks/migration.rake b/lib/tasks/migration.rake index 1750964..f07109e 100644 --- a/lib/tasks/migration.rake +++ b/lib/tasks/migration.rake @@ -8,4 +8,12 @@ namespace :libr_migrate do end end + task :strip_blanks_from_posts => :environment do + Post.all.each do |post| + post.title.try(:strip!) + post.save if post.changed? + end + + end + end \ No newline at end of file