Sha256: ccb6355d680b2e4d6d98f89aa0e52fc61ba50c334e378e5699e6385b6663ce37
Contents?: true
Size: 354 Bytes
Versions: 34
Compression:
Stored size: 354 Bytes
Contents
class RemoveEolsFromAttachmentsFilename < ActiveRecord::Migration def up Attachment.where("filename like ? or filename like ?", "%\r%", "%\n%").each do |attachment| filename = attachment.filename.to_s.tr("\r\n", "_") Attachment.where(:id => attachment.id).update_all(:filename => filename) end end def down # nop end end
Version data entries
34 entries across 34 versions & 1 rubygems