> How about this approach (suggested by Adam Milligan): > > class ActiveResource::Base > def self.connect(current_site) > old_site = site > begin > self.site = current_site > connection(:refresh) > yield > ensure > self.site = old_site > end > end > end > > This would also need to be made threadsafe, but isn't it essentially > the same thing Koz suggested, without a dependency on DelayedJob?
This is basically exactly what I was suggesting, apologies for not being clearer ;). -- 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.