Module: MonarchMigrate::Migration::Lookup

Included in:
Rspec::Generators::DataMigrationGenerator, TestUnit::Generators::DataMigrationGenerator
Defined in:
lib/monarch_migrate/migration.rb

Instance Method Summary collapse

Instance Method Details

#migration_exists?(dirname, file_name) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/monarch_migrate/migration.rb', line 10

def migration_exists?(dirname, file_name)
  migration_lookup_at(dirname).grep(/\d+_#{file_name}.rb$/).first
end

#migration_lookup_at(dirname) ⇒ Object



6
7
8
# File 'lib/monarch_migrate/migration.rb', line 6

def migration_lookup_at(dirname)
  Dir.glob("#{dirname}/[0-9]*_*.rb")
end