Sha256: 32d7af54c8c8b59d8f338532795bd5445d47f7ea842e2eba69e5f06d65032966

Contents?: true

Size: 363 Bytes

Versions: 8

Compression:

Stored size: 363 Bytes

Contents

class Create<%= model.cp %> < ActiveRecord::Migration
  def self.up
    create_table :<%= model.p %> do |t|
<% model.fields.map do |k, v| %>
  <%= "      t." + v + " :" + k  %>
<% end %>
<% model.foreign_keys.map do |k, v| %>
  <%= "      t.references :" + k %>
<% end %>
      t.timestamps
    end
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mattknox-goaloc-0.0.3 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.0.5 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.0.6 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.0.7 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.0.8 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.0.9 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.1.0 lib/goaloc/generators/rails/migration.rb.erb
mattknox-goaloc-0.2.0 lib/goaloc/generators/rails/migration.rb.erb