migration to set content types of all existing attachments

pull/1171/head
Martin Linkhorst 11 years ago
parent fb096b0c86
commit d7c6609779
  1. 11
      db/migrate/20140430125956_reset_content_types.rb

@ -0,0 +1,11 @@
class ResetContentTypes < ActiveRecord::Migration
def up
Attachment.all.each do |attachment|
attachment.update_column(:content_type, Attachment.content_type_for(attachment.diskfile))
end
end
def down
# noop
end
end
Loading…
Cancel
Save