diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-03 23:43:26 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-03 23:43:26 -0800 |
commit | a10f30963d9dfb8b470e2ec5e293b20be8fcbe3d (patch) | |
tree | 9a47272576e438d68c50901f090bb8379fa6ed11 | |
parent | 63f7a61246aa570ed6891cdd225df8d67e4ecc13 (diff) | |
parent | 6012970fea9d3385cd0a515aa353b47d0837d55a (diff) | |
download | rails-a10f30963d9dfb8b470e2ec5e293b20be8fcbe3d.tar.gz rails-a10f30963d9dfb8b470e2ec5e293b20be8fcbe3d.tar.bz2 rails-a10f30963d9dfb8b470e2ec5e293b20be8fcbe3d.zip |
Merge pull request #4288 from kennyj/fix_4285-2
(3-2-stable) Fix GH #4285. Remove options when we record calling create_table
-rw-r--r-- | activerecord/lib/active_record/migration/command_recorder.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/migration/command_recorder_test.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb index ffee5a081a..4e27293cb4 100644 --- a/activerecord/lib/active_record/migration/command_recorder.rb +++ b/activerecord/lib/active_record/migration/command_recorder.rb @@ -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) diff --git a/activerecord/test/cases/migration/command_recorder_test.rb b/activerecord/test/cases/migration/command_recorder_test.rb index d108b456f0..8f136bce2b 100644 --- a/activerecord/test/cases/migration/command_recorder_test.rb +++ b/activerecord/test/cases/migration/command_recorder_test.rb @@ -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 |