diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-13 20:42:25 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-13 20:42:25 +0200 |
commit | 25647f70215e38635d16038e71f47730f2717021 (patch) | |
tree | b32383b3b2116e5078e3d4ccb821d0d255661bd7 /railties/lib/generators/active_record | |
parent | b9f4ea7198aadaeaaf6761316f0d3c96e73e4753 (diff) | |
download | rails-25647f70215e38635d16038e71f47730f2717021.tar.gz rails-25647f70215e38635d16038e71f47730f2717021.tar.bz2 rails-25647f70215e38635d16038e71f47730f2717021.zip |
Add some attribute readers to migration module.
Diffstat (limited to 'railties/lib/generators/active_record')
3 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/generators/active_record/migration/templates/migration.rb b/railties/lib/generators/active_record/migration/templates/migration.rb index 2851f7cb42..bbb7c53d86 100644 --- a/railties/lib/generators/active_record/migration/templates/migration.rb +++ b/railties/lib/generators/active_record/migration/templates/migration.rb @@ -1,4 +1,4 @@ -class <%= @migration_class_name %> < ActiveRecord::Migration +class <%= migration_class_name %> < ActiveRecord::Migration def self.up<% attributes.each do |attribute| %> <%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end -%> <%- end %> diff --git a/railties/lib/generators/active_record/model/templates/migration.rb b/railties/lib/generators/active_record/model/templates/migration.rb index 542e9db2fc..1f68487304 100644 --- a/railties/lib/generators/active_record/model/templates/migration.rb +++ b/railties/lib/generators/active_record/model/templates/migration.rb @@ -1,4 +1,4 @@ -class <%= @migration_class_name %> < ActiveRecord::Migration +class <%= migration_class_name %> < ActiveRecord::Migration def self.up create_table :<%= table_name %> do |t| <% for attribute in attributes -%> diff --git a/railties/lib/generators/active_record/session_migration/templates/migration.rb b/railties/lib/generators/active_record/session_migration/templates/migration.rb index 19811d9455..919822af7b 100644 --- a/railties/lib/generators/active_record/session_migration/templates/migration.rb +++ b/railties/lib/generators/active_record/session_migration/templates/migration.rb @@ -1,4 +1,4 @@ -class <%= @migration_class_name %> < ActiveRecord::Migration +class <%= migration_class_name %> < ActiveRecord::Migration def self.up create_table :<%= session_table_name %> do |t| t.string :session_id, :null => false |