mongo_session_store 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongo_session_store/mongo_mapper.rb +6 -4
- metadata +2 -2
@@ -3,12 +3,12 @@ require 'mongo_mapper'
|
|
3
3
|
module ActionController
|
4
4
|
module Session
|
5
5
|
class MongoMapperStore < AbstractStore
|
6
|
-
|
6
|
+
|
7
7
|
class Session
|
8
8
|
include MongoMapper::Document
|
9
9
|
key :data, String, :default => [Marshal.dump({})].pack("m*")
|
10
10
|
timestamps!
|
11
|
-
|
11
|
+
|
12
12
|
ensure_index :updated_at
|
13
13
|
end
|
14
14
|
|
@@ -40,6 +40,8 @@ module ActionController
|
|
40
40
|
def find_session(id)
|
41
41
|
@@session_class.find(id) ||
|
42
42
|
@@session_class.new(:id=>id)
|
43
|
+
rescue Mongo::InvalidObjectID
|
44
|
+
@@session_class.new(:id => generate_sid)
|
43
45
|
end
|
44
46
|
|
45
47
|
def pack(data)
|
@@ -50,7 +52,7 @@ module ActionController
|
|
50
52
|
return nil unless packed
|
51
53
|
Marshal.load(packed.unpack("m*").first)
|
52
54
|
end
|
53
|
-
|
55
|
+
|
54
56
|
end
|
55
57
|
end
|
56
|
-
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_session_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Nicolas M\xC3\xA9rouze"
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2010-
|
14
|
+
date: 2010-03-05 00:00:00 +01:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|