Sha256: 214982a95345627ab2e4da6210e2d246f70baf8e16ccfc0454244443c420f225
Contents?: true
Size: 1.29 KB
Versions: 31
Compression:
Stored size: 1.29 KB
Contents
require 'erb' require 'yaml' require 'rubypitaya/core/setup' module RubyPitaya class DatabaseConfig def initialize() @setup = Setup.new @config = { 'adapter' => 'postgresql', 'encoding' => 'unicode', 'pool' => @setup.fetch('rubypitaya.database.pool', 5), 'host' => @setup['rubypitaya.database.host'], 'user' => @setup['rubypitaya.database.user'], 'password' => @setup['rubypitaya.database.password'], 'database' => @setup['rubypitaya.database.name'], } @config['database'] = "#{@config['database']}_test" if @environment_name == 'test' end def config @config end def connection_data { 'adapter': config['adapter'], 'encoding': config['encoding'], 'pool': config['pool'], 'host': config['host'], 'user': config['user'], 'password': config['password'], 'database': config['database'], } end def connection_data_without_database { 'adapter': config['adapter'], 'encoding': config['encoding'], 'pool': config['pool'], 'host': config['host'], 'user': config['user'], 'password': config['password'], } end def database_name config['database'] end end end
Version data entries
31 entries across 31 versions & 1 rubygems