Sha256: 20f90ab4ca982894a143c579c8b4e5b2f20c46fde5919990ee7ad7137600972a

Contents?: true

Size: 564 Bytes

Versions: 3

Compression:

Stored size: 564 Bytes

Contents

def activate_for_active_record(db)
  remove_file 'config/database.yml'
  copy_file "assets/config/database_#{db[:name]}.yml", 'config/database.yml'

  discard_gem 'sqlite3'
  if db[:version]
    gather_gem db[:gem_name], db[:version]
  else
    gather_gem db[:gem_name]
  end
end

databases = {
  mysql: { name: 'mysql', gem_name: 'mysql2', version: '~> 0.3.18', relational: true },
  postgresql: { name: 'postgresql', gem_name: 'pg', relational: true }
}

if db = databases[get(:database).to_sym]
  if db[:relational]
    activate_for_active_record(db)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
potassium-1.3.5 lib/potassium/templates/application/recipes/database.rb
potassium-1.3.4 lib/potassium/templates/application/recipes/database.rb
potassium-1.3.3 lib/potassium/templates/application/recipes/database.rb