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 configure_multiple_databases(bindings)
    production_db = bindings.detect { |b| b[:name] && b[:name] =~ /^.*production$|^.*prod$/ }
    if production_db
      write_database_yaml(production_db)
    else
      puts "Unable to determine primary database from multiple: #{bindings.inspect}"
      exit 1
    end
  end
def configure_multiple_databases ( bindings ) production_db = bindings . detect { | b | b [ :name ] && b [ :name ] =~ / ^.*production$|^.*prod$ / } if production_db write_database_yaml ( production_db ) else puts "Unable to determine primary database from multiple: #{bindings.inspect}" exit 1 end end
Prepares a database.yml file for the app, if needed.
Prepares a database . yml file for the app if needed .
# Where possible, select one named '^.*production' or 'prod' before failing.
bindings