class Terrazine::Config
Public Class Methods
connection(conn = nil)
click to toggle source
# File lib/terrazine/config.rb, line 9 def connection(conn = nil) @@connection ||= conn c = conn || @@connection # Proc because of closing PG::Connection by rails on production -_- c.is_a?(Proc) ? c.call : c end
connection!(conn = nil)
click to toggle source
# File lib/terrazine/config.rb, line 16 def connection!(conn = nil) connection(conn) || raise # TODO: error end
set(params)
click to toggle source
# File lib/terrazine/config.rb, line 4 def set(params) # another way? @@connection = params[:connection] if params[:connection] end