Class: Virgo::MigrationsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/virgo/migrations/migrations_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migrationsObject



5
6
7
8
9
10
11
12
13
# File 'lib/generators/virgo/migrations/migrations_generator.rb', line 5

def copy_migrations
  Dir["#{engine_root}/db/migrate/*.rb"].each do |abs_path|
    relative_path = abs_path.gsub("#{engine_root}/", '')

    unless File.directory?(abs_path)
      copy_file relative_path, relative_path
    end
  end
end

#engine_rootObject



15
16
17
# File 'lib/generators/virgo/migrations/migrations_generator.rb', line 15

def engine_root
  File.expand_path('../../../../..', __FILE__)
end