Sha256: b79216b6ac1b02d79a452ac1378a0e384e84df90adb8eba49c7fa240927f1ce2

Contents?: true

Size: 394 Bytes

Versions: 18

Compression:

Stored size: 394 Bytes

Contents

class Create<%= plural_class_name %> < ActiveRecord::Migration
  def self.up
    create_table :<%= plural_name %> do |t|
    <%- for attribute in model_attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
    <%- end -%>
    <%- unless options[:skip_timestamps] -%>
      t.timestamps
    <%- end -%>
    end
  end
  
  def self.down
    drop_table :<%= plural_name %>
  end
end

Version data entries

18 entries across 18 versions & 6 rubygems

Version Path
llab-generators-0.1.5 lib/generators/lab/scaffold/templates/migration.rb
llab-generators-0.1.4 lib/generators/lab/scaffold/templates/migration.rb
llab-generators-0.1.3 lib/generators/scaffold/templates/migration.rb
llab-generators-0.1.2 lib/generators/scaffold/templates/migration.rb
llab-generators-0.1.1 lib/generators/scaffold/templates/migration.rb
llab-generators-0.1 lib/generators/scaffold/templates/migration.rb
vileda-generators-0.1.0 lib/generators/vileda/scaffold/templates/migration.rb
niftier-generators-0.1.2 lib/generators/niftier/scaffold/templates/migration.rb
niftier-generators-0.1.1 lib/generators/niftier/scaffold/templates/migration.rb
niftier-generators-0.1.0 lib/generators/niftier/scaffold/templates/migration.rb
corntrace-nifty-generators-0.4.1 lib/generators/nifty/scaffold/templates/migration.rb
corntrace-nifty-generators-0.4.0 lib/generators/nifty/scaffold/templates/migration.rb
nifty-generators-0.4.0 lib/generators/nifty/scaffold/templates/migration.rb
very_nifty_generators-0.2.1 lib/generators/nifty/scaffold/templates/migration.rb
very_nifty_generators-0.2.0 lib/generators/nifty/scaffold/templates/migration.rb
very_nifty_generators-0.1.2 lib/generators/nifty/scaffold/templates/migration.rb
very_nifty_generators-0.1.1 lib/generators/nifty/scaffold/templates/migration.rb
very_nifty_generators-0.1.0 lib/generators/nifty/scaffold/templates/migration.rb