aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-05-06 01:48:19 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-05-06 01:48:19 +0000
commit4cbbebb1c3385a232a6943b92ff41697ab97cb27 (patch)
tree6075f7bfaa234138f44183181d1bcc8ab6836098 /railties
parent0306e4a20483a91d9288ac6f20e6b79db6eca7a7 (diff)
downloadrails-4cbbebb1c3385a232a6943b92ff41697ab97cb27.tar.gz
rails-4cbbebb1c3385a232a6943b92ff41697ab97cb27.tar.bz2
rails-4cbbebb1c3385a232a6943b92ff41697ab97cb27.zip
Added short-hand declaration style to migrations (inspiration from Sexy Migrations, http://errtheblog.com/post/2381) [DHH] Updated resource_scaffold and model generators to use short-hand style migrations [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/rails_generator/generators/components/model/templates/migration.rb2
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb2
3 files changed, 4 insertions, 2 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 153d49af75..ee72dec0bc 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Updated resource_scaffold and model generators to use short-hand style migrations [DHH]
+
* Updated initializer to only load #{RAILS_ENV}.rb once. Added deprecation warning for config.breakpoint_server. [Nicholas Seckar]
* Removed breakpointer and Binding.of_caller in favor of relying on ruby-debug by Kent Sibilev since the breakpointer has been broken since Ruby 1.8.4 and will not be coming back [DHH]
diff --git a/railties/lib/rails_generator/generators/components/model/templates/migration.rb b/railties/lib/rails_generator/generators/components/model/templates/migration.rb
index 2a305a6a9d..cb1ddd399e 100644
--- a/railties/lib/rails_generator/generators/components/model/templates/migration.rb
+++ b/railties/lib/rails_generator/generators/components/model/templates/migration.rb
@@ -2,7 +2,7 @@ class <%= migration_name %> < ActiveRecord::Migration
def self.up
create_table :<%= table_name %> do |t|
<% for attribute in attributes -%>
- t.column :<%= attribute.name %>, :<%= attribute.type %>
+ t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
end
end
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb
index 2a305a6a9d..cb1ddd399e 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb
@@ -2,7 +2,7 @@ class <%= migration_name %> < ActiveRecord::Migration
def self.up
create_table :<%= table_name %> do |t|
<% for attribute in attributes -%>
- t.column :<%= attribute.name %>, :<%= attribute.type %>
+ t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
end
end