Sha256: 2dd1c3a3ff246e298e95182ab84804a7b28f4b9bed9bdf0f5fc859ae77c38994

Contents?: true

Size: 306 Bytes

Versions: 10

Compression:

Stored size: 306 Bytes

Contents

class Create<%= model_class.pluralize %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
    <%- fields.each do |name, type| -%>
      t.<%= type %> :<%= name %>
    <%- end -%>
      t.timestamps
    end
  end

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

Version data entries

10 entries across 5 versions & 1 rubygems

Version Path
humdrum-rails-0.1.3 lib/rails/generators/humdrum/resource/templates/migrations/create_resources.rb
humdrum-rails-0.1.3 lib/rails/generators/humdrum/api/templates/migrations/create_resources.rb
humdrum-rails-0.1.2 lib/rails/generators/humdrum/api/templates/migrations/create_resources.rb
humdrum-rails-0.1.2 lib/rails/generators/humdrum/resource/templates/migrations/create_resources.rb
humdrum-rails-0.1.1 lib/rails/generators/humdrum/resource/templates/migrations/create_resources.rb
humdrum-rails-0.1.1 lib/rails/generators/humdrum/api/templates/migrations/create_resources.rb
humdrum-rails-0.0.9 lib/rails/generators/humdrum/resource/templates/migrations/create_resources.rb
humdrum-rails-0.0.9 lib/rails/generators/humdrum/api/templates/migrations/create_resources.rb
humdrum-rails-0.0.8 lib/rails/generators/humdrum/api/templates/migrations/create_resources.rb
humdrum-rails-0.0.8 lib/rails/generators/humdrum/resource/templates/migrations/create_resources.rb