summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-17 12:34:31 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-08-17 12:34:31 +0200
commit3a29646d73b7afdf2a2356c7e92ed397cc80009f (patch)
tree71225f819b0e4a7e08804fc090a026137d481874
parent56d24bcf80c7b6e93e298adb8214f4b2e97d094b (diff)
downloadgitlab-ce-3a29646d73b7afdf2a2356c7e92ed397cc80009f.tar.gz
Disable migrations output in migrations helpers
-rw-r--r--spec/support/migrations_helpers.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/support/migrations_helpers.rb b/spec/support/migrations_helpers.rb
index 3e8c6b54c5a..255b3d96a62 100644
--- a/spec/support/migrations_helpers.rb
+++ b/spec/support/migrations_helpers.rb
@@ -36,16 +36,30 @@ module MigrationsHelpers
end
def schema_migrate_down!
- ActiveRecord::Migrator
- .migrate(migrations_paths, migration_schema_version)
+ disable_migrations_output do
+ ActiveRecord::Migrator.migrate(migrations_paths,
+ migration_schema_version)
+ end
+
reset_column_in_migration_models
end
def schema_migrate_up!
- ActiveRecord::Migrator.migrate(migrations_paths)
+ disable_migrations_output do
+ ActiveRecord::Migrator.migrate(migrations_paths)
+ end
+
reset_column_in_migration_models
end
+ def disable_migrations_output
+ ActiveRecord::Migration.verbose = false
+
+ yield
+ ensure
+ ActiveRecord::Migration.verbose = true
+ end
+
def migrate!
ActiveRecord::Migrator.up(migrations_paths) do |migration|
migration.name == described_class.name