Skip to content

Commit

Permalink
Updated format of migrations to ActiveRecord 2.0 style
Browse files Browse the repository at this point in the history
  • Loading branch information
pjb3 committed Mar 16, 2008
1 parent bfba4ec commit b47d471
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -2,9 +2,11 @@ class <%= model_class_name %>Migration < ActiveRecord::Migration
def self.up
<%= "create_table :#{table_name} do |t|" if table_name %>
<% for attribute in model_attributes -%>
t.column :<%= attribute.first %>, :<%= attribute.last %>
t.<%= "%-11s" % attribute.last %> :<%= attribute.first %>
<% end -%>
<%= "end" if table_name %>
t.timestamps
<%= "end" if table_name %>
end

def self.down
Expand Down

0 comments on commit b47d471

Please sign in to comment.