aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-01-03 20:50:58 -0800
committerJosé Valim <jose.valim@gmail.com>2012-01-03 20:50:58 -0800
commit4b81007acf33527522aa41965e4a476602d2dd4d (patch)
treea39b6353286ebd75e1fcff55ed134a093a39348c
parent00c5342d96a3677c0a6a2bb8316c76182f5bdfdd (diff)
parent28afb01fe389db0505dd8f3e6a061e645273883d (diff)
downloadrails-4b81007acf33527522aa41965e4a476602d2dd4d.tar.gz
rails-4b81007acf33527522aa41965e4a476602d2dd4d.tar.bz2
rails-4b81007acf33527522aa41965e4a476602d2dd4d.zip
Merge pull request #4286 from kennyj/fix_4285
Fix GH #4285. Remove options when we record calling creat_table
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb2
-rw-r--r--activerecord/test/cases/migration/command_recorder_test.rb6
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