Sha256: 0c4821fb206e9ea72f8fc231ef10fb38bb13916045a05a539905bc9798f55f69

Contents?: true

Size: 468 Bytes

Versions: 33

Compression:

Stored size: 468 Bytes

Contents

class Create<%= class_name.pluralize.delete('::') %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name || plural_name.split('/').last %> 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 :<%= table_name || plural_name.split('/').last %>
  end
end

Version data entries

33 entries across 33 versions & 11 rubygems

Version Path
aslon_scaffold-0.0.15 lib/generators/nifty/scaffold/templates/migration.rb
aslon_scaffold-0.0.14 lib/generators/nifty/scaffold/templates/migration.rb
aslon_scaffold-0.0.13 lib/generators/nifty/scaffold/templates/migration.rb
aslon_scaffold-0.0.12 lib/generators/nifty/scaffold/templates/migration.rb
bootstrapped-2.0.4 lib/generators/bootstrapped/scaffold/templates/migration.rb
bootstrapped-2.0.3 lib/generators/bootstrapped/scaffold/templates/migration.rb
bravo-generators-0.1.1 lib/generators/bravo/scaffold/templates/migration.rb
bootstrapped-1.0.1 lib/generators/bootstrapped/scaffold/templates/migration.rb
bootstrapped-1.0.0 lib/generators/bootstrapped/scaffold/templates/migration.rb
bootstrapped-0.9.0 lib/generators/bootstrapped/scaffold/templates/migration.rb
kickoff-0.0.2 lib/generators/kickoff/scaffold/templates/migration.rb
bootstrapped-0.0.6 lib/generators/bootstrapped/scaffold/templates/migration.rb
datalab-generators-0.1.0 lib/generators/datalab/scaffold/templates/migration.rb
bootstrapped-0.0.4 lib/generators/bootstrapped/scaffold/templates/migration.rb
entropi-bootstrap-rails-0.1.0 lib/generators/bootstrap/scaffold/templates/migration.rb
nifty-generators-improved-0.5 lib/generators/nifty/scaffold/templates/migration.rb
flockonus-nifty-generators-0.0.12 lib/generators/nifty/scaffold/templates/migration.rb
zoo-generators-0.1.5 lib/generators/zoo/scaffold/templates/migration.rb
zoo-generators-0.1.4 lib/generators/zoo/scaffold/templates/migration.rb
zoo-generators-0.1.3 lib/generators/zoo/scaffold/templates/migration.rb