Permalink
Browse files

Allow Rails 2 sexy migrations style declarations

  assert_table :dogs do |t|
    t.integer :id, :default => 2
    t.string :name, :email
  end
  • Loading branch information...
1 parent 527bee2 commit 0db0ddca41be5c05686be23632deb44df3c62a0c @bkeepers bkeepers committed Mar 8, 2009
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/migration_test_helper.rb
@@ -155,5 +155,12 @@ def verify #:nodoc:
actual_indexes = conn.indexes(@name).collect { |i| "name <#{i.name}> columns <#{i.columns.join(",")}> unique <#{i.unique}>" }
assert_equal @indexes.sort, actual_indexes.sort, "wrong indexes for table: <#{name}>"
end
+
+ def method_missing(type, *columns)
+ options = columns.extract_options!
+ columns.each do |colname|
+ column colname, type, options
+ end
+ end
end
end

0 comments on commit 0db0ddc

Please sign in to comment.