Simple SQL query from a legacy db

Where there is a will there is a way.
There is a common misconception that Rails cannot connect to two
databases, and this is not entirly true. You can connect rails to
multiple databases(you can't connect models to multiple database, well
at least not easily). So in this case, you'd connect rails to your
main DB(which I presume you already have) and then also connect it to
the legacy database but you just have a User model that uses that
second db connection. So anytime you do a User.find(:all) or maybe in
your case User.find_by_sql(insert sql statement here) you will be
interacting with your old db.

Does that make any sense at all?


Gab Gabi wrote: