Store FlashHashes in the session as plain hashes #8183

merged 1 commit into from Nov 21, 2012

2 participants


FAO @jonleighton, a retry of #8017

@jcoglan jcoglan Store FlashHashes in the session as plain hashes rather than custom o…
…bjects with unstable class names and instance variables.

Refactor FlashHash to take values for its ivars in the constructor, to pretty up FlashHash.from_session_value.

Remove stale comment on FlashHash: it is no longer Marshaled in the session so we can change its implementation.

Remove blank lines I introduced in controller/test_case.rb.

Unit tests for FlashHash#to_session_value.

Put in a compatibility layer to accept FlashHash serializations from Rails 3.0+.

Test that Rails 3.2 session flashes are correctly converted to the new format.

Remove code path for processing Rails 3.0 FlashHashes since they can no longer deserialize.

Fix session['flash'] deletion condition: it will never be empty?, it will either be nil or a hash with 'discard' and 'flashes' keys.
@jonleighton jonleighton merged commit 293c121 into rails:master Nov 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment