mongoid/mongo_session_store

Type error with Rails 7.0.2 and Ruby 3.1.1

eromas opened this issue · 2 comments

Hello there,
I get:

TypeError at /documents can't dump IO.

mongo_session_store (3.2.1) lib/mongo_session_store/mongoid_store.rb, line 17

   store_in collection: MongoSessionStore.collection_name

    field :_data, type: BSON::Binary, default: -> { pack({}) }

    def self.pack(data)

17 BSON::Binary.new(Marshal.dump(data), :generic)

    end

Note:
This error does not appear with Rails 6.1.4.6 and Ruby 3.1.1

PS:
This error appears if params[...] is stored to mongoid session store.
It does not appear if params[...].to_enum.to_h is stored to mongoid session store instead.

Hi @eromas, thanks for the report! I haven't had time to look into it. Looks like the CI is also no longer working for this project, so it's a bit of a chore to get a fix out. If you manage to find a fix or workaround, please let us know :)

Hi, I found a workaround here:
https://dev.to/notapatch/rails-going-backwards-56h5
Solution 4: Back with session