Sha256: e33859b2d4c964ea6445a8f8151226872f0ed1b8cc0377d2a253d1b936151f40

Contents?: true

Size: 377 Bytes

Versions: 8

Compression:

Stored size: 377 Bytes

Contents

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
paperclip-3.3.1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.2.1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.3.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.2.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.1.4 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.1.2 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.1.1 lib/generators/paperclip/templates/paperclip_migration.rb.erb
paperclip-3.1.0 lib/generators/paperclip/templates/paperclip_migration.rb.erb