Disable migrations output in migrations helpers
This commit is contained in:
		
							parent
							
								
									56d24bcf80
								
							
						
					
					
						commit
						3a29646d73
					
				| 
						 | 
				
			
			@ -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!
 | 
			
		||||
    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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue