I have a situation where I\'m trying to build a web app which takes a total count of records in a table and outputs it to the screen. Sounds simple right...?
The mai
A gem called active-record-sql-adapter lets you connect to an SQL Server db via ActiveRecord. You can do something like
class RemodeDB
establish_connection(:remote_db) #<=
self.abstract_class = true # to avoid Rails' no associated model exception
end
then have your classes inherit the connection like so
class Product < RemoteDB
self.table_name ...
end
Note that in order to connect to earlier versions of SQL Server (2005 in your case), you would need an earlier version of the gem which may not be compatible with your current version of Rails.