Does anyone know how to make a model connect to a remote database and only for that specific model? That way I can do the typical CRUD functions on a remote server? -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Check out establish_connection: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001075 b Aryk Grosz wrote:> Does anyone know how to make a model connect to a remote database and > only for that specific model? > > That way I can do the typical CRUD functions on a remote server? >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 4/24/07, Aryk Grosz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Does anyone know how to make a model connect to a remote database and > only for that specific model? > > That way I can do the typical CRUD functions on a remote server? >AFAIK distributed transactions with Ruby/Rails is an unsolved problem. If neccessary, your best bet is probably talking to a Java or .net -based backend over a web service, or perhaps having a look at JRuby; which can probably work with JTA. However, if you, like most rails/php/web/mysql programmers, don''t care about or need data integrity, connecting one of your models to a different db is fairly simple. Start at <http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases>, and/or search this groups archives for "multiple databases". HTH, Isak> -- > Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---