Sha256: 85de49b33ffab634e62cd9395afb1eb412e4a411fe17b6f999c716dc869b208a

Contents?: true

Size: 342 Bytes

Versions: 3

Compression:

Stored size: 342 Bytes

Contents

class Create<%= goal.cp %> < ActiveRecord::Migration
  def self.up
    create_table :<%= goal.p %> do |t|
<%= goal.fields.map { |k, v| "      t.#{v} :#{k}" }.join("\n") %> 
<%= goal.foreign_keys.map { |k, v| "      t.#{v} :#{k[0..-4]}" }.join("\n") %> 
      t.timestamps
    end
  end

  def self.down
    drop_table :<%= goal.p %>
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mattknox-goaloc-0.4.4 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.4.5 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.4.7 lib/goaloc/generators/rails/migration.erb