Sha256: e12e44de93eadb75ce21fab4c67cecac0e117d94249c4c63ca7fcbe65ffe0897

Contents?: true

Size: 494 Bytes

Versions: 12

Compression:

Stored size: 494 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def self.up
<% attachment_names.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
<% attachment_names.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 lib/generators/paperclip_database/migration/templates/migration.rb.erb
paperclip_database-1.0.5 lib/generators/paperclip_database/migration/templates/migration.rb.erb
paperclip_database-1.0.4 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.3 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.2 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.1 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-1.0.0 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.3.0 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.2.0 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.1.0 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.0.2 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb
paperclip_database-0.0.1 lib/generators/paperclip_database/templates/paperclip_database_migration.rb.erb