Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- desc 'Remove new lines from guest comments'
- task :remove_comment_quotes do
- class Guest < ActiveRecord::Base
- def comment=(comment)
- super( comment.gsub(/\r\n/, ' ') )
- end
- end
- Guest.all.each {|guest| guest.comment+='' unless guest.comment.nil? }
- end
Add Comment
Please, Sign In to add comment