Class: Impex::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/impex/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_exportObject



7
8
9
10
11
12
13
14
15
# File 'lib/generators/impex/install_generator.rb', line 7

def generate_export
  initializer_path = "#{Rails.root}/config/initializers/impex.rb"
  copy_file "impex.rb", initializer_path

  if history_manager == "activerecord"
    migration_path = "#{Rails.root}/db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}_create_impex_histories.rb"
    copy_file "create_impex_history.rb", migration_path
  end
end