Class: MageRecord::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/magerecord/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(hostname, db, user, pwd) ⇒ Connection

Returns a new instance of Connection.



3
4
5
6
7
8
9
10
11
# File 'lib/magerecord/connection.rb', line 3

def initialize(hostname, db, user, pwd)
  ActiveRecord::Base.establish_connection(
    adapter: 'mysql2',
    host: hostname,
    database: db,
    username: user,
    password: pwd
  )
end