Class: Multitenant::InstallGenerator

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

Constant Summary collapse

CONFIG_FILE_NAME =
'multitenant_mysql_conf.rb'

Instance Method Summary collapse

Instance Method Details

#copy_conf_file_into_appObject



9
10
11
12
13
14
15
# File 'lib/generators/multitenant/install/install_generator.rb', line 9

def copy_conf_file_into_app
  dest = "config/initializers/#{CONFIG_FILE_NAME}"
  return if FileTest.exist?(dest) # to prevent overwritting of existing file
  src = File.expand_path(File.dirname(__FILE__)) + "/templates/#{CONFIG_FILE_NAME}"
  FileUtils.copy_file src, dest
  p "The file was created `#{dest}`"
end