Closed dplummer closed 10 years ago
It probably isn't a good idea to use MultiJson
for the encoder in rails 3 because I think the FlashHash implementation doesn't serialize as json well.
Oh, maybe I should name the key serializer
instead of encoder_class
. What do you think?
I prefer serializer
, yup.
@dplummer Did you happen to check if there's a precedent for this, perhaps in the Dalli session store?
Excellent question. I looked through the source of dalli and rails' memcache store and I don't see how it marshal's it. I'll keep looking.
@dplummer don't sweat it! I was mostly just curious :smiley_cat:
Thanks for asking about precedent. I tracked down rails issue #13692, which adds similar behavior to the built-in cookie store. Hold up on merging this PR, I want to review what @lukesarnacki did and support the same interface.
Hi @dplummer, this was actually rewritten so you will probably have better luck looking at this one rails/rails#13945
@dplummer sorry about the conflicts! :scream_cat:
Alright, so I rewrote it to allow you to specify the serializer as :marshal
, :json
, or :hybrid
. :marshal
is default.
I'm requiring json
. I'm not sure if that's the right thing to do, but I don't know what else to do here.
@dplummer you get a chance to look at the conflicts yet?
Thanks for the bump, I've rebased on master.
@dplummer yay!
This adds a configuration option for the encoder class to use. In Rails 4, this allows the use of
MultiJson
for the encoder: