#41 strip blanks from post title, add rake task

This commit is contained in:
2015-12-02 21:30:29 +08:00
parent 1cc0e6c76c
commit e918290c1f
+8
View File
@@ -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