Module: Atchu::Connection

Extended by:
Connection
Included in:
Connection
Defined in:
lib/atchu/connection.rb

Instance Method Summary collapse

Instance Method Details

#connect(yml_file) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/atchu/connection.rb', line 7

def connect yml_file
  return if yml_file.empty?
  if @connection.blank?
    ActiveRecord::Base.establish_connection(YAML.load_file(yml_file)[:db])
    @connection = ActiveRecord::Base.connection
  end
  @connection
end

#getObject



16
17
18
# File 'lib/atchu/connection.rb', line 16

def get
  @connection
end