M
Mischa Berger
Hello everyone,
This is the first time I want to use ActiveRecord outside Rails. This is
my (simplified) code:
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:username => 'username',
assword => 'password',
:database => 'database')
class Rate < ActiveRecord::Base
end
r = Rate.findfirst)
r.value = new_rate
r.save!
This works fine, but I was wondering if I have to close any database
connections at the end of my script (by using remove_connection??)? Or
is does AR take care of this automatically?
Thanks in advance.
Mischa.
This is the first time I want to use ActiveRecord outside Rails. This is
my (simplified) code:
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:username => 'username',
assword => 'password',
:database => 'database')
class Rate < ActiveRecord::Base
end
r = Rate.findfirst)
r.value = new_rate
r.save!
This works fine, but I was wondering if I have to close any database
connections at the end of my script (by using remove_connection??)? Or
is does AR take care of this automatically?
Thanks in advance.
Mischa.