@@ -2,7 +2,7 class RemoveEolsFromAttachmentsFilename < ActiveRecord::Migration | |||||
2 | def up |
|
2 | def up | |
3 | Attachment.where("filename like ? or filename like ?", "%\r%", "%\n%").each do |attachment| |
|
3 | Attachment.where("filename like ? or filename like ?", "%\r%", "%\n%").each do |attachment| | |
4 | filename = attachment.filename.to_s.tr("\r\n", "_") |
|
4 | filename = attachment.filename.to_s.tr("\r\n", "_") | |
5 |
Attachment.where(:id => attach |
|
5 | Attachment.where(:id => attachment.id).update_all(:filename => filename) | |
6 | end |
|
6 | end | |
7 | end |
|
7 | end | |
8 |
|
8 |
General Comments 0
You need to be logged in to leave comments.
Login now