On Sun, Dec 13, 2009 at 7:19 PM, Chad Woolley <thewoolley...@gmail.com> wrote: > This causes problems in the following scenario: > > 1. You use ActiveResource to post data to an external site using > subdomains for individual accounts (e.g. Lighthouse) > 2. You want your app to allow multiple users to do this (register > their Lighthouse account/URI to automatically push their data from > your app to Lighthouse). > > There's no way I can see to support this other than creating a > separate (dynamically named) class for each user/site.
The shopify API has this same issue, the solution there is to dynamically switch out the site in a before_filter / at the start of every delayed_job worker. It's not an ideal solution but it's way easier than doing dynamically named classes. > Questions: > * Is there a reason it can't/shouldn't be an instance variable? What would the api look like here? I could see something like > * If there is a good reason, are there any workarounds or third-party > alternatives which don't have this limitation (other than directly > handling the HTTP calls)? Take a look at how the shopify API works, it's been really really nice to deal with, and while switching out the site in a filter isn't the coolest-looking solution, it's similar to using multiple database connections in an AR app. > Thanks, > -- Chad > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-c...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > > -- Cheers Koz -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-c...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.