Sha256: a5f36ca58576db12c12621fa5cfcedafabce3558966de147bd27e35979d7b792

Contents?: true

Size: 590 Bytes

Versions: 4

Compression:

Stored size: 590 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
<% for attachment in attachments -%>
      t.string   :<%= attachment %>_file_name
      t.string   :<%= attachment %>_content_type
      t.integer  :<%= attachment %>_file_size
      t.datetime :<%= attachment %>_updated_at
<% end -%>
<% unless options[:skip_timestamps] %>
      t.timestamps
<% end -%>
    end
  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
view_mapper-0.3.4 lib/view_mapper/views/paperclip/templates/migration.rb
view_mapper-0.3.3 lib/view_mapper/views/paperclip/templates/migration.rb
view_mapper-0.3.2 lib/view_mapper/views/paperclip/templates/migration.rb
view_mapper-0.3.1 lib/view_mapper/views/paperclip/templates/migration.rb