Sha256: d0afce3aff6339e59c813e08a4ddf03f52f8bde0d8cdf5411b359841b8a871b7

Contents?: true

Size: 466 Bytes

Versions: 10

Compression:

Stored size: 466 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'
  gather_gem db[:gem_name]
end

databases = {
  mysql: { name: 'mysql', gem_name: 'mysql2', 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

10 entries across 10 versions & 1 rubygems

Version Path
potassium-1.3.2 lib/potassium/templates/application/recipes/database.rb
potassium-1.3.0 lib/potassium/templates/application/recipes/database.rb
potassium-1.2.4 lib/potassium/templates/application/recipes/database.rb
potassium-1.2.3 lib/potassium/templates/application/recipes/database.rb
potassium-1.2.2 lib/potassium/templates/application/recipes/database.rb
potassium-1.2.1 lib/potassium/templates/application/recipes/database.rb
potassium-1.2.0 lib/potassium/templates/application/recipes/database.rb
potassium-1.1.0 lib/potassium/templates/application/recipes/database.rb
potassium-1.0.1 lib/potassium/templates/application/recipes/database.rb
potassium-1.0.0 lib/potassium/templates/application/recipes/database.rb