Description: ========This is a fairly simple but handy plugin that lets you specify which database connection to use on a per-model basis. It is useful when you have multiple applications sharing the same data, in other words, this is just a nicer way of using “Model.establish_connection(database)”. Example: ======First create a ‘shared’ database configuration in config/database.yml: shared: adapter: mysql database: shared_database username: user password: password host: dbs_host Next tell your model that it should connect the the ‘shared’ database and use the table there… class ZipCode < ActiveRecord::Base # Uses the ''shared'' database in all environments uses_connection :shared, :in => :all end ... and the next time you do ZipCode.find(:first) or any other interaction with the ZipCode model it will use the zip_codes table in your shared database. Where to get it: ==========GitHb: http://github.com/railsfreaks/uses_connection More info: http://www.railsfreaks.com/2008/5/2/introducing-the-uses_connection-rails-plugin -- Thiago Jackiw http://www.railsfreaks.com --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---