diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-12 10:28:49 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-12 10:28:49 +0100 |
commit | d8287a7dbcc287791ed069cfc14ca6b9db0e66a7 (patch) | |
tree | cd8e2612c5e3ec488eb8f444e47b1a4d2ebbe963 /config | |
parent | 0b9e91fd4654ac5c73072f9e77025abc3060c0c0 (diff) |
Fixed a logic if/else bug.
Diffstat (limited to 'config')
-rw-r--r-- | config/database.yml | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/config/database.yml b/config/database.yml index 2a7dcb5..364cbdb 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,17 +1,23 @@ <% system_odbc_ini_file = '/var/lib/freeswitch/.odbc.ini' %> -<% if File.exists?(system_odbc_ini_file) %> -<% system_odbc_configuration = IniFile.load(system_odbc_ini_file) %> -<% if !system_odbc_configuration['gemeinschaft']['DATABASE'].blank? && !system_odbc_configuration['gemeinschaft']['USER'].blank? %> +<% if !File.exists?(system_odbc_ini_file) %> +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + production: - adapter: mysql2 + adapter: mysql2 encoding: utf8 - database: <%= system_odbc_configuration['gemeinschaft']['DATABASE'] %> + database: gemeinschaft pool: 10 - username: <%= system_odbc_configuration['gemeinschaft']['USER'] %> - password: <%= system_odbc_configuration['gemeinschaft']['PASSWORD'] %> + username: gemeinschaft + password: gemeinschaft socket: /var/run/mysqld/mysqld.sock reconnect: true - +<% else %> +<% system_odbc_configuration = IniFile.load(system_odbc_ini_file) %> +<% if !system_odbc_configuration['gemeinschaft']['DATABASE'].blank? && !system_odbc_configuration['gemeinschaft']['USER'].blank? %> development: adapter: mysql2 encoding: utf8 @@ -21,24 +27,14 @@ development: password: <%= system_odbc_configuration['gemeinschaft']['PASSWORD'] %> socket: /var/run/mysqld/mysqld.sock reconnect: true -<% else %> -production: - adapter: mysql2 - encoding: utf8 - database: gemeinschaft - pool: 10 - username: gemeinschaft - password: gemeinschaft - socket: /var/run/mysqld/mysqld.sock - reconnect: true -development: +production: adapter: mysql2 encoding: utf8 - database: gemeinschaft - pool: 5 - username: gemeinschaft - password: gemeinschaft + database: <%= system_odbc_configuration['gemeinschaft']['DATABASE'] %> + pool: 10 + username: <%= system_odbc_configuration['gemeinschaft']['USER'] %> + password: <%= system_odbc_configuration['gemeinschaft']['PASSWORD'] %> socket: /var/run/mysqld/mysqld.sock reconnect: true <% end %> |