mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-09 05:15:53 +10:00
#41 strip blanks from post title, add rake task
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user