Class: DataMigrater::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/data_migrater/collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(path = "#{Rails.root}/db/data_migrate") ⇒ Collection

Returns a new instance of Collection.



5
6
7
# File 'lib/data_migrater/collection.rb', line 5

def initialize(path = "#{Rails.root}/db/data_migrate")
  @path = path
end

Instance Method Details

#migrationsObject



9
10
11
12
13
# File 'lib/data_migrater/collection.rb', line 9

def migrations
  Dir.entries(@path).sort.map do |migration_file|
    migration_for migration_file
  end.compact
end