I’m having a problem with sessions since upgrading to EdgeRails. Against
certain recomendations, I’m storing the current user’s model object in
the session. This worked fine in 1.0 and earlier, but now I am noticing
that any time I reference the associated objects for an object stored in
the session, the associated objects get copied into the session! For
example, session[:user].posts will copy all of the users’s posts into
the session. If i delete a post from the database, the session still
returns the deleted post unless I reload the session[:user] object.
Is there anything I can do to restore the old session behavior? I don’t
really want to rewrite my app to store the current user in a different
way. My User model references some of user properties that are only
stored in the session. It would be a non-trivial task to change this.
Also, I don’t want to have to worry about reloading the user every time
I change the database.