Sha256: 25b9fa951e5d036e5b90cd5b00dcdee291b49382f0446643ad7965912f3dc3de

Contents?: true

Size: 370 Bytes

Versions: 11

Compression:

Stored size: 370 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def self.up
    change_table :<%= table_name %> do |t|
<% attachment_names.each do |attachment| -%>
      t.attachment :<%= attachment %>
<% end -%>
    end
  end

  def self.down
<% attachment_names.each do |attachment| -%>
    drop_attached_file :<%= table_name %>, :<%= attachment %>
<% end -%>
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
paperclip-4.1.1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-4.1.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.5.4 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-4.0.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.5.3 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.5.2 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.5.1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.5.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.4.2 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.4.1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.4.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb