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



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

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



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

def get
  @connection
end