aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-09-03 11:17:27 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-09-03 11:30:36 +0900
commit3cce7628e4e3a4f43ed53db1f2756c4d9d1f1e00 (patch)
tree0a12bec26cc804c7a78d2e6b4c234ad3af1a0f4d /activerecord/test/support
parent268a55f5efc4366d2295e452542be5a846509234 (diff)
downloadrails-3cce7628e4e3a4f43ed53db1f2756c4d9d1f1e00.tar.gz
rails-3cce7628e4e3a4f43ed53db1f2756c4d9d1f1e00.tar.bz2
rails-3cce7628e4e3a4f43ed53db1f2756c4d9d1f1e00.zip
Reset ActiveRecord::SchemaDumper.ignore_tables value after changed in tests
Diffstat (limited to 'activerecord/test/support')
-rw-r--r--activerecord/test/support/schema_dumping_helper.rb9
1 files changed, 9 insertions, 0 deletions
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