Class: ActiveJobTracker::Generators::MigrationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveJobTracker::Generators::MigrationsGenerator
- Defined in:
- lib/generators/active_job_tracker/migrations_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_migrations ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/active_job_tracker/migrations_generator.rb', line 10 def copy_migrations migration_files = Dir.glob(File.join(self.class.source_root, "migrations", "*.rb")) migration_files.each do |file| migration_filename = File.basename(file) new_filename = "#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_#{migration_filename}" copy_file "migrations/#{migration_filename}", "db/migrate/#{new_filename}" sleep(1) if migration_files.count > 1 end end |