Sha256: d7d3c0ddcb9d57d8814f2f7d0bb342b832911566db297919e5154a91c972fc49

Contents?: true

Size: 487 Bytes

Versions: 182

Compression:

Stored size: 487 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def change
    create_table :<%= table_name %> do |t|
<% attributes.each do |attribute| -%>
      t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
<% end -%>
<% if options[:timestamps] %>
      t.timestamps
<% end -%>
    end
<% attributes_with_index.each do |attribute| -%>
    add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
<% end -%>
  end
end

Version data entries

182 entries across 151 versions & 16 rubygems

Version Path
starter_generators-0.7.0 lib/generators/starter/resource/templates/migration.rb
activerecord-3.2.14 lib/rails/generators/active_record/model/templates/migration.rb
starter_generators-0.6.0 lib/generators/starter/resource/templates/migration.rb
activerecord-3.2.14.rc2 lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.14.rc1 lib/rails/generators/active_record/model/templates/migration.rb
swipe-rails-0.0.5 vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/model/templates/migration.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/rails/generators/active_record/model/templates/migration.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/rails/generators/active_record/model/templates/migration.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/rails/generators/active_record/model/templates/migration.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/rails/generators/active_record/model/templates/migration.rb
challah-1.0.0.beta3 vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/model/templates/migration.rb
starter_generators-0.5.2 lib/generators/starter/resource/templates/migration.rb
starter_generators-0.5.1 lib/generators/starter/resource/templates/migration.rb
starter_generators-0.5.0 lib/generators/starter/resource/templates/migration.rb
starter_generators-0.4.2 lib/generators/starter/resource/templates/migration.rb
starter_generators-0.4.1 lib/generators/starter/resource/templates/migration.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/rails/generators/active_record/model/templates/migration.rb
challah-1.0.0.beta2 vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/model/templates/migration.rb
challah-1.0.0.beta vendor/bundle/gems/activerecord-3.2.13/lib/rails/generators/active_record/model/templates/migration.rb
challah-1.0.0.beta vendor/bundle/gems/activerecord-3.2.11/lib/rails/generators/active_record/model/templates/migration.rb