Sha256: 837b19193724fd1ba97257bfef132971217eecaae5982933d95f3f9187dc99c5

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

class Create<%= class_name.pluralize.delete('::') %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
    <%- model_attributes.each do |attribute| -%>
      t.<%= attribute.type %> :<%= attribute.name %>
    <%- end -%>
    <%- unless options[:skip_timestamps] -%>
      t.timestamps
    <%- end -%>
    end
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stager-0.2.2 lib/generators/stager/model/templates/migration.rb