Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix GH #4285. Remove options when we record calling creat_table

  • Loading branch information...
commit 28afb01fe389db0505dd8f3e6a061e645273883d 1 parent 00c5342
Toshinori Kajihara kennyj authored
2  activerecord/lib/active_record/migration/command_recorder.rb
View
@@ -59,7 +59,7 @@ def #{method}(*args) # def create_table(*args)
private
def invert_create_table(args)
- [:drop_table, args]
+ [:drop_table, [args.first]]
end
def invert_rename_table(args)
6 activerecord/test/cases/migration/command_recorder_test.rb
View
@@ -67,6 +67,12 @@ def test_invert_create_table
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
Please sign in to comment.
Something went wrong with that request. Please try again.