class GhostSchema::MigrationStore

Attributes

after_migrating_migrations[RW]
before_migrating_migrations[RW]
original_migrations_paths[RW]

Public Class Methods

copy_files() click to toggle source
# File lib/ghost_schema/migration_store.rb, line 8
def copy_files
  copy_target_files.each do |file|
    FileUtils.copy(file, GhostSchema.migrations_path)
  end
end

Private Class Methods

copy_target_files() click to toggle source
# File lib/ghost_schema/migration_store.rb, line 16
def copy_target_files
  patterns = /#{diff_versions.join('|')}/

  original_migrations_paths.flat_map do |migrations_path|
    pattern = File.join(migrations_path, '*')
    Dir.glob(pattern).select {|x| patterns.match?(x) }
  end
end
diff_versions() click to toggle source
# File lib/ghost_schema/migration_store.rb, line 25
def diff_versions
  after_migrating_migrations - before_migrating_migrations
end