From 3cce7628e4e3a4f43ed53db1f2756c4d9d1f1e00 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 3 Sep 2014 11:17:27 +0900 Subject: Reset ActiveRecord::SchemaDumper.ignore_tables value after changed in tests --- activerecord/test/support/schema_dumping_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/test/support') diff --git a/activerecord/test/support/schema_dumping_helper.rb b/activerecord/test/support/schema_dumping_helper.rb index 2ae8d299e5..2d1651454d 100644 --- a/activerecord/test/support/schema_dumping_helper.rb +++ b/activerecord/test/support/schema_dumping_helper.rb @@ -8,4 +8,13 @@ module SchemaDumpingHelper ensure ActiveRecord::SchemaDumper.ignore_tables = old_ignore_tables end + + def dump_all_table_schema(ignore_tables) + old_ignore_tables, ActiveRecord::SchemaDumper.ignore_tables = ActiveRecord::SchemaDumper.ignore_tables, ignore_tables + stream = StringIO.new + ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) + stream.string + ensure + ActiveRecord::SchemaDumper.ignore_tables = old_ignore_tables + end end -- cgit v1.2.3