Class: Virgo::MigrationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Virgo::MigrationsGenerator
- Defined in:
- lib/generators/virgo/migrations/migrations_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_migrations ⇒ Object
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_root ⇒ Object
15 16 17 |
# File 'lib/generators/virgo/migrations/migrations_generator.rb', line 15 def engine_root File.('../../../../..', __FILE__) end |