Sha256: bbf0ed31dfc7702a34d7e87ec17cc9a559b48a31effdf949d11f7ecfbb9ea7c2

Contents?: true

Size: 514 Bytes

Versions: 12

Compression:

Stored size: 514 Bytes

Contents

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

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

Version data entries

12 entries across 12 versions & 1 rubygems

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