Store flash in the session in Rails 4 style on Rails 2/3/4
Different versions of Rails have stored flash messages in different objects in
the session, making it a pain to upgrade without nuking everyones session. The
ActionDispatch::Session::SessionRestoreError making life difficult.
This gem was created because we wanted to be able to keep our users Rails 2 sessions working on Rails 3, and we figured as long as we're going to be doing crazy stuff we might as well go and use the far more sensible practice from Rails 4 of storing the flash as basic ruby types and sweeping the flash before persisting into the session.
For more details of the how and why, check out our blog post Happily upgrading Ruby on Rails at production scale.