Mark Reginald James wrote:
>
> Perhaps something like:
>
> module ContactService
> def self.set_account(url, key)
> Thread.current[:api_conn] = ApiConn.new(url, key)
> end
>
> def api_contact_add(data)
> Thread.current[:api_conn].api_perform('ContactService', 'add',
> data)
> end
> end
>
> before_filter do
> ContactService.set_account(
> "#{current_account.api_url}.application.com",
> current_account.api_key)
> end
>
>
> --
> Rails Wheels - Find Plugins, List & Sell Plugins -
> http://railswheels.com
Hey Mark,
Thanks for the response. I think I'm following what you're suggesting.
Is that multi-thread safe for the newer versions of rails?
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---