> I am looking for a way to access a database without active record.
> Basically when i call a certain action, I want to delete a customer from
> the database linked via active record, and insert that customer into
> another database on the same server but not linked to this RoRapp.
>
you can still use AR even through multiple connections. Each AR model
can have a different database connection. By default they will use the
connection associated to the current environment, but you can just do
class MyModel< ActiveRecord::Base
| establish_connection :differentdb
end
|
And your "MyModel" objects will use the :differentdb connection, which
will be the entry in your database.yml file under the name differentdb:
If you are going to use many models with a sepparate connection you can
even make an "abstract" AR class with only that line for establishing
the connection and then have your models extend from this one.
Of course you can still use Ruby DBI and make all the process manually,
but in that case you have to take care of managing the connection and
with AR you can just forget about low level and concentrate on business
logic.
regards,
javier ramirez
--
--------
Estamos de estreno... si necesitas llevar el control de tus gastos visita
http://www.gastosgem.com !!Es gratis!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---