The code powering m.abunchtell.com https://m.abunchtell.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

13 satır
477 B

  1. class AddTypeToMediaAttachments < ActiveRecord::Migration[5.0]
  2. def up
  3. add_column :media_attachments, :type, :integer, default: 0, null: false
  4. MediaAttachment.where(file_content_type: MediaAttachment::IMAGE_MIME_TYPES).update_all(type: MediaAttachment.types[:image])
  5. MediaAttachment.where(file_content_type: MediaAttachment::VIDEO_MIME_TYPES).update_all(type: MediaAttachment.types[:video])
  6. end
  7. def down
  8. remove_column :media_attachments, :type
  9. end
  10. end