Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 28afb01fe389db0505dd8f3e6a061e645273883d 1 parent 00c5342
Toshinori Kajihara authored January 04, 2012
2  activerecord/lib/active_record/migration/command_recorder.rb
@@ -59,7 +59,7 @@ def #{method}(*args)          # def create_table(*args)
59 59
       private
60 60
 
61 61
       def invert_create_table(args)
62  
-        [:drop_table, args]
  62
+        [:drop_table, [args.first]]
63 63
       end
64 64
 
65 65
       def invert_rename_table(args)
6  activerecord/test/cases/migration/command_recorder_test.rb
@@ -67,6 +67,12 @@ def test_invert_create_table
67 67
         assert_equal [:drop_table, [:system_settings]], drop_table
68 68
       end
69 69
 
  70
+      def test_invert_create_table_with_options
  71
+        @recorder.record :create_table, [:people_reminders, {:id => false}]
  72
+        drop_table = @recorder.inverse.first
  73
+        assert_equal [:drop_table, [:people_reminders]], drop_table
  74
+      end
  75
+
70 76
       def test_invert_rename_table
71 77
         @recorder.record :rename_table, [:old, :new]
72 78
         rename = @recorder.inverse.first

0 notes on commit 28afb01

Please sign in to comment.
Something went wrong with that request. Please try again.