Re: Auditing: session[:user] reference in after_save callback

Jan Foeh
2008-04-23T22:00:13Z

Here''s a solution by Pratik, although I have the feeling that
he''s, err,
somehow opposed to it. Just a gut feeling :)

http://m.onkey.org/2007/10/17/how-to-access-session-cookies-params-request-in-model

Another solution mentioned in the first Rails Recipes book was to
(mis)use ActionController::Caching::Sweeping; because of their task,
Sweepers are observers that have access to the current controller. I
have yet to use them, but this approach seems to be quite clean to me.
Take a look at a comment by August Lilleaas in Pratiks article, he has
some example code for this.

HTH.
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org