Start here, and google for other examples:
http://api.rubyonrails.com/classes/ActiveRecord/Base.html
(I'm currently trying to avoid this issue myself in a company app, but I
don't think it will go away, and I won't be able to avoid it for much
longer - I'll have to connect to MySQL, SQL Server, and Oracle - sigh)
--
Posted via http://www.ruby-forum.com/.
Set up the database connection in database.yml. Let's say it's named
"sybasefu".
In the models that need to access that database do this:
class SomeThing < ActiveRecord::Base
establish_connection "sybasefu"
#....
end
One thing to check is if you have several models that need to connect
to sybasefu, *each* one will open it's own connection. Unlike your
"normal" models which share a single database connection. This was
true for Rails 1.1.6 (and yes, I realize how old that is :). To get
around it I did this:
class MySybaseClasses < ActiveRecord::Base
establish_connection "sybasefu"
end
class Something < MySpaceClasses
#....
end
class SomethingElse < MySpaceClasses
#...
end
That may or may not still be an issue, but it's something to check.
If it isn't, let me know :)
-philip