I''m not really sure, so I''m posting this here to see if I can get some clarification on what I may be doing wrong. I''m in the process of trying to put a User model into the session scope. Along with that I would like to have it''s relationships. However, when I add the model to the session scope, all I get is the model and it''s direct attributes, no accessors for the has_one or has_many models that are within it. Consider the following example - User - has_one :address Address - belongs_to :user application.rb model :user, :address @session[:user] = User.new gives me a user class for the symbol :user, but with no accessors to the address class. Am I missing something I should be doing? Or is what I''m trying to do not possible? Cheers, Robby
Tyler Kiley
2005-Jul-18 17:51 UTC
Re: Relationships lost when adding models to the session
> However, when I add the model to the session scope, all I get is the > model and it''s direct attributes, no accessors for the has_one or > has_many models that are within it.Have you tried clearing your cookies and starting over with a new session? I''ve had similar issues a couple of times when I start a session, change the db schema/model, and then try to use an old object in the session... Tyler