diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-01-01 01:15:42 +0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-04 11:16:52 -0800 |
commit | 9e64dfad0df4ed8a10d2ad2a17cd0848017d652c (patch) | |
tree | 8f77591fd7aa3a9c98dbbc336ada4cb327d4ae68 /activerecord/lib/rails/generators/active_record/model/templates | |
parent | 40afcade0dc1450e765a91fc15a6ac6d442c9826 (diff) | |
download | rails-9e64dfad0df4ed8a10d2ad2a17cd0848017d652c.tar.gz rails-9e64dfad0df4ed8a10d2ad2a17cd0848017d652c.tar.bz2 rails-9e64dfad0df4ed8a10d2ad2a17cd0848017d652c.zip |
Use Rails 3.1 `change` method in model generator
Diffstat (limited to 'activerecord/lib/rails/generators/active_record/model/templates')
-rw-r--r-- | activerecord/lib/rails/generators/active_record/model/templates/migration.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/rails/generators/active_record/model/templates/migration.rb b/activerecord/lib/rails/generators/active_record/model/templates/migration.rb index 7d4e1a7404..cd2552d9b8 100644 --- a/activerecord/lib/rails/generators/active_record/model/templates/migration.rb +++ b/activerecord/lib/rails/generators/active_record/model/templates/migration.rb @@ -1,5 +1,5 @@ class <%= migration_class_name %> < ActiveRecord::Migration - def up + def change create_table :<%= table_name %> do |t| <% for attribute in attributes -%> t.<%= attribute.type %> :<%= attribute.name %> @@ -13,8 +13,4 @@ class <%= migration_class_name %> < ActiveRecord::Migration add_index :<%= table_name %>, :<%= attribute.name %>_id <% end -%> end - - def down - drop_table :<%= table_name %> - end end |