Commit 3a29646d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Disable migrations output in migrations helpers

parent 56d24bcf
...@@ -36,16 +36,30 @@ module MigrationsHelpers ...@@ -36,16 +36,30 @@ module MigrationsHelpers
end end
def schema_migrate_down! def schema_migrate_down!
ActiveRecord::Migrator disable_migrations_output do
.migrate(migrations_paths, migration_schema_version) ActiveRecord::Migrator.migrate(migrations_paths,
migration_schema_version)
end
reset_column_in_migration_models reset_column_in_migration_models
end end
def schema_migrate_up! def schema_migrate_up!
ActiveRecord::Migrator.migrate(migrations_paths) disable_migrations_output do
ActiveRecord::Migrator.migrate(migrations_paths)
end
reset_column_in_migration_models reset_column_in_migration_models
end end
def disable_migrations_output
ActiveRecord::Migration.verbose = false
yield
ensure
ActiveRecord::Migration.verbose = true
end
def migrate! def migrate!
ActiveRecord::Migrator.up(migrations_paths) do |migration| ActiveRecord::Migrator.up(migrations_paths) do |migration|
migration.name == described_class.name migration.name == described_class.name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment