Sha256: 67e7add7974c81e67819b9e0b90f01e479fc0bcdd44dde161f0f9045f7c9d801

Contents?: true

Size: 478 Bytes

Versions: 12

Compression:

Stored size: 478 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def self.up
<% attachments.each do |attachment| -%>
    create_table :<%= class_name.underscore %>_<%= attachment.pluralize %> do |t|
      t.integer    :<%= class_name.underscore %>_id
      t.string     :style
      t.binary     :file_contents
    end
<% end -%>
  end

  def self.down
<% attachments.each do |attachment| -%>
    drop_table :<%= class_name.underscore %>_<%= attachment.pluralize %>
<% end -%>
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
paperclip_database-2.0.0 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.5 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.4 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.3 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.2 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.1 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.0 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.3.0 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.2.0 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.1.0 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.0.2 generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.0.1 generators/paperclip_database/templates/paperclip_database_migration.rb.erb