Class: Travis::Config::Heroku::Database
- Inherits:
-
Struct
- Object
- Struct
- Travis::Config::Heroku::Database
- Includes:
- Travis::Config::Helpers
- Defined in:
- lib/travis/config/heroku/database.rb
Constant Summary collapse
- VARIABLES =
{ application_name: ENV['DYNO'] || $0, statement_timeout: 10_000 }
- DEFAULTS =
{ adapter: 'postgresql', encoding: 'unicode', variables: VARIABLES }
Instance Attribute Summary collapse
-
#options ⇒ Object
writeonly
Sets the attribute options.
Instance Method Summary collapse
Methods included from Travis::Config::Helpers
#blank?, #camelize, #compact, #deep_merge, #deep_symbolize_keys
Instance Attribute Details
#options=(value) ⇒ Object
Sets the attribute options
6 7 8 |
# File 'lib/travis/config/heroku/database.rb', line 6 def (value) @options = value end |
Instance Method Details
#config ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/travis/config/heroku/database.rb', line 12 def config config = compact(Url.parse(url).to_h) config = deep_merge(DEFAULTS, config) unless config.empty? config[:pool] = pool.to_i if pool config[:prepared_statements] = prepared_statements != 'false' if prepared_statements config end |