Benjamin Harel
Benjamin Harel

Reputation: 2946

session_store does not work

I try to store user http sessions in mongodb. I've found this nice gem: https://github.com/biilmann/mongo_sessions and trying to use it. I get undefined method `master' for Mongoid:Module

than I've changed the old

:collection => lambda { Mongoid.master.collection('sessions') }

to something that should work and bring sessions collection:

Mongoid::Sessions.default.collections.find{|i| i.name == 'sessions'}

But I'm getting: undefined method `find_one' for Moped::Collection

Upvotes: 3

Views: 239

Answers (1)

platforms
platforms

Reputation: 2726

In your Gemfile, try using the Github repository for this gem instead of the one hosted on rubygems.org. There was a pull request submitted within the last few weeks that has been merged into master, but not yet published as a gem. It looks like it might address your issue.

gem "mongo_sessions", :require => "mongo_sessions/rails_mongo_store", :git => 'git://github.com/biilmann/mongo_sessions'

Upvotes: 2

Related Questions