Using ActiveResource to copy models with the same class?

Stephen Bannasch
Tue, 22 May 2007 18:37:35 -0000

I''d like to be able to copy model objects from one site instance of
my rails application to another and I''m wondering if I can use or
adapt ActiveRecord for this purpose.

The problem I have at the start is that the models have the same
classname on both sites.

So while this works great in script/console running on railsapp1.domain.com:

   class Activity < ActiveResource::Base
     self.site = "http://railsapp2.domain.com"
   end

   activities = Activity.find(:all)

It''s not clear how I now get access to the local ActiveRecord class
called Activity on the running rails instance railsapp1.domain.com.

Has anybody tried doing this?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---