staging/lib/vcap/staging/plugin/rails3/database_support.rb
# Prepares a database.yml file for the app, if needed.
# Returns the service binding that was used for the 'production' db entry.
Prepares a database.yml file for the app, if needed.
Returns the service binding that was used for the 'production' db entry.
Prepares a database . yml file for the app if needed . Returns the service binding that was used for the ' production ' db entry .
def database_config_for(binding)
    case binding[:label]
    when /^mysql/
      { 'adapter' => 'mysql2', 'encoding' => 'utf8', 'pool' => 5,
        'reconnect' => false }.merge(credentials_from(binding))
    when /^postgresql/
      { 'adapter' => 'postgresql', 'encoding' => 'utf8', 'pool' => 5,
        'reconnect' => false }.merge(credentials_from(binding))
    else
      raise "Unable to configure unknown database: #{binding.inspect}"
    end
  end
def database_config_for ( binding ) case binding [ :label ] when / ^mysql / { 'adapter' => 'mysql2' , 'encoding' => 'utf8' , 'pool' => 5 , 'reconnect' => false } . merge ( credentials_from ( binding ) ) when / ^postgresql / { 'adapter' => 'postgresql' , 'encoding' => 'utf8' , 'pool' => 5 , 'reconnect' => false } . merge ( credentials_from ( binding ) ) else raise "Unable to configure unknown database: #{binding.inspect}" end end
Prepares a database.yml file for the app, if needed.
Prepares a database . yml file for the app if needed .
# Should never get here, so it is an exception not 'exit 1'
binding