This project is archived and is in readonly mode.
can't store non-activerecord models in session
-
Jeremy Kemper
- Milestone cleared.
Classic problem: Marshal.load doesn't invoke const_missing.
It works in 2.2.2 because the Cart constant is already set when the session is unmarshaled. Not sure why this changed in 2.3.
-
Sam Ruby
Fixing that will simply let me move onto the next problem.
/!\ FAILSAFE /!\ Tue Feb 03 21:02:03 -0500 2009 Status: 500 Internal Server Error You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.include? /home/rubys/.gem/ruby/1.8/gems/activerecord-2.3.0/lib/active_record/attribute_methods.rb:142:in `create_time_zone_conversion_attribute?'There appears to be a few places where there is an assumption that objects in sessions are ActiveRecords.
-
josh
- State changed from new to open
So is this an AR specific problem? Storing Arrays and nested hashes still works I'm assuming.
None of this was intentional and we should have it fixed for the final 2.3 release.
-
Sam Ruby
It is cool that it is not intentional.
My guess -- and it is just a guess -- that from a code perspective there may be a number of unrelated small problems. But, and again this is just a guess: there may be a gaping hole in the test suite.
I have what amounts to an integration test, namely a script that implements the depot application in the Agile Web Development with Rails book, as well as a few other small scenarios. It works on 2.2.2, except for one part that was a regression in that release. It doesn't get very far with 2.3RC0.
It is not currently structured in a way that enables it to be immediately picked up as such, but I'd like to work with somebody to use this to enhance the test suite for Rails. I'd be willing to do the bulk of the work.
-
josh
Note to self: See 2-2-stable CGIRequest#stale_session_check! for the rescue method catch these types of errors.
-
Michael Koziarski
I think this is caused because we've pushed out the session saving till outside the dispatch hook.
This means we're marshalling the using 'broken vestigial' constants mentioned in #1339 AR::Base should not be nuking its children, just because it lost interest.
-
josh
- State changed from open to resolved
It looks like this commit solved the specific issue.
http://github.com/rails/rails/co...
Please open new tickets for any related issues and assign them to me.
