Sha256: 4876de868d7e817fb5c43af0d4c72c7bf958c2b4332e318ae8b68d5fc3ce6aea

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def self.up
<% attachments.each do |attachment| -%>
    create_table :<%= name.underscore.camelize.tableize.tr('/', '_') %>_<%= attachment.pluralize %> do |t|
      t.integer    :<%= name.underscore.camelize.tableize.tr('/', '_') %>_id
      t.string     :style
      t.binary     :file_contents
    end
  end
<% end -%>

  def self.down
<% attachments.each do |attachment| -%>
    drop_table :<%= name.underscore.camelize.tableize.tr('/', '_') %>_<%= attachment.pluralize %>
<% end -%>
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paperclip_database-2.2.0 generators/templates/paperclip_database_migration.rb.erb