ActiveResource - multiple 'sites'

Hi all,

Hopefully what I'm trying to do here won't seem too nobby:

I have a 'master' application which I am using to control
'deployments' of applications (one deployment per customer).

I can easily use AR to link my slave app's into my master as there is
one fixed address i.e. self.site = 'master_url'.

My dilema comes with creating a form of integration the other way,
i.e. having one API model that can link to many different app's.

What is the best route for achieving this? I assume I can do something
along the lines of the below but wondering if there is a better way
that I'm not thinking of??

ApiModel.new
ApiModel.set_site(slave_app_path)
ApiModel.method

many thanks,

Paul

bump!

Hi all,

Hopefully what I'm trying to do here won't seem too nobby:

I have a 'master' application which I am using to control
'deployments' of applications (one deployment per customer).

I can easily use AR to link my slave app's into my master as there is
one fixed address i.e.self.site= 'master_url'.

My dilema comes with creating a form of integration the other way,
i.e. having one API model that can link to many different app's.

What is the best route for achieving this? I assume I can do something
along the lines of the below but wondering if there is a better way
that I'm not thinking of??

ApiModel.new
ApiModel.set_site(slave_app_path)
ApiModel.method

You might also want to consider creating subclasses (possibly anonymous) on the fly. Might end up easier if you need to manipulate many objects from different sites at the same time

Fred