Merge pull request #4286 from kennyj/fix_4285

Fix GH #4285. Remove options when we record calling creat_table
This commit is contained in:
José Valim 2012-01-03 20:50:58 -08:00
commit 4b81007acf
2 changed files with 7 additions and 1 deletions

View File

@ -59,7 +59,7 @@ module ActiveRecord
private
def invert_create_table(args)
[:drop_table, args]
[:drop_table, [args.first]]
end
def invert_rename_table(args)

View File

@ -67,6 +67,12 @@ module ActiveRecord
assert_equal [:drop_table, [:system_settings]], drop_table
end
def test_invert_create_table_with_options
@recorder.record :create_table, [:people_reminders, {:id => false}]
drop_table = @recorder.inverse.first
assert_equal [:drop_table, [:people_reminders]], drop_table
end
def test_invert_rename_table
@recorder.record :rename_table, [:old, :new]
rename = @recorder.inverse.first