Caching of collections/references on session?

I’m using the user engine and therefore have a current_user User object
on my sessions. User has a collection called ‘properties’ and I am
accessing the Property objects via the current_user session variable and
also directly with Property.find. The problem I have is that rails seems
to be caching the properties collection over requests (I can see the
collection objects encoded the session files on disk). So after changing
a Property object via Property.find, I have stale data in my session.

I don’t think this is supposed to be the default behaviour (I think
everything was fine before I upgraded to rails 1.1.2). I found this in a
change log for action pack:

Action Pack 1.1.0

  • Added search through session to clear out association caches at the
    end of each request. This makes it possible to place Active Record
    objects in the session without worrying about stale data in the
    associations (the main object is still subject to caching, naturally)
    #347 [Tobias L.]

Maybe I have switched this behaviour off somehow?

Any help, much appreciated,


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs