Class: CargoWiki::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/cargo_wiki/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migrations_filesObject



14
15
16
17
18
19
20
21
22
# File 'lib/generators/cargo_wiki/install_generator.rb', line 14

def copy_migrations_files
  empty_directory "db/migrate"

  migrations_folder = File.expand_path("../../../../db/migrate", __FILE__)
  Dir["#{migrations_folder}/*.rb"].each do |file|
    filename = File.basename(file)
    copy_file file, "db/migrate/#{filename}"
  end
end