Class: BazaMigrations::Migrate
- Inherits:
-
Object
- Object
- BazaMigrations::Migrate
- Defined in:
- lib/baza_migrations/migrate.rb
Instance Method Summary collapse
Instance Method Details
#execute_all_migrations(direction) ⇒ Object
14 15 16 |
# File 'lib/baza_migrations/migrate.rb', line 14 def execute_all_migrations(direction) migrations.execute_migrations(direction) end |
#migrations ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/baza_migrations/migrate.rb', line 2 def migrations executor = BazaMigrations::MigrationsExecutor.new(db: Baza.default_db) paths.each do |path| migrations_path = "#{path}/db/baza_migrate" next unless File.exist?(migrations_path) executor.add_dir(migrations_path) end executor end |
#paths ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/baza_migrations/migrate.rb', line 18 def paths Enumerator.new do |yielder| yielder << Dir.pwd Gem.loaded_specs.each do |_name, loaded_spec| yielder << loaded_spec.gem_dir end end end |