Session data in observer

Hello,

In my app, there is an observer that gets fired when an change is done
on one table. what i want it to do is to write into an other table the
action done and the user which made the action.

But until now i didn't manage to get the session data into the
observer. I always get "session, undefined methode for observer"

Any ideas how i can handle this?

thank you

Observers, like models, are not meant to have access to the session. It’s a violation of the MVC pattern.

You’re not really supposed to be doing what you’re doing. It does make doing auditing a bit harder. However, the Rails Recipes book shows how you can hack cache_sweepers to do what you’re trying to do.

Hello thank you i will try to have a look to the receipe book. but i
also think about using a filter before just to respect the MVC
pattern.
Thank you