mongo_session_store icon indicating copy to clipboard operation
mongo_session_store copied to clipboard

Type error with Rails 7.0.2 and Ruby 3.1.1

Open eromas opened this issue 2 years ago • 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.

eromas avatar Feb 26 '22 15:02 eromas

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 :)

tombruijn avatar Mar 09 '22 14:03 tombruijn

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

eromas avatar Mar 10 '22 11:03 eromas