Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix GH #4285. Remove options when we record calling creat_table
  • Loading branch information
kennyj committed Jan 4, 2012
1 parent 00c5342 commit 28afb01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -59,7 +59,7 @@ def #{method}(*args) # def create_table(*args)
private private


def invert_create_table(args) def invert_create_table(args)
[:drop_table, args] [:drop_table, [args.first]]
end end


def invert_rename_table(args) def invert_rename_table(args)
Expand Down
6 changes: 6 additions & 0 deletions activerecord/test/cases/migration/command_recorder_test.rb
Expand Up @@ -67,6 +67,12 @@ def test_invert_create_table
assert_equal [:drop_table, [:system_settings]], drop_table assert_equal [:drop_table, [:system_settings]], drop_table
end 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 def test_invert_rename_table
@recorder.record :rename_table, [:old, :new] @recorder.record :rename_table, [:old, :new]
rename = @recorder.inverse.first rename = @recorder.inverse.first
Expand Down

0 comments on commit 28afb01

Please sign in to comment.