Class: Wellcar::Templates::DatabaseYaml

Inherits:
Base
  • Object
show all
Defined in:
lib/wellcar/templates/database_yaml.rb

Instance Method Summary collapse

Methods inherited from Base

#exist?, #render, #write

Constructor Details

#initialize(app_name) ⇒ DatabaseYaml

Returns a new instance of DatabaseYaml.



6
7
8
9
10
# File 'lib/wellcar/templates/database_yaml.rb', line 6

def initialize(app_name)
  super "config/database.yml"
  with_attributes app_name: app_name
  with_template "database.yml.erb"
end

Instance Method Details

#updateObject



12
13
14
15
16
# File 'lib/wellcar/templates/database_yaml.rb', line 12

def update
  # back up existing file
  FileUtils.mv file_path, "config/database.pre_docker.yml"
  self.write
end