mongoid_sessions 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mongoid/session_store/session.rb +4 -2
- data/lib/mongoid_sessions/version.rb +1 -1
- data/lib/mongoid_sessions.rb +2 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1
|
1
|
+
1.0.1
|
@@ -10,17 +10,19 @@ module Mongoid
|
|
10
10
|
field :session_id
|
11
11
|
field :raw_data
|
12
12
|
|
13
|
+
store_in :collection => :sessions, :database => 'mongoid_session_store'
|
14
|
+
|
13
15
|
def self.find_by_session_id(session_id)
|
14
16
|
where(:session_id => session_id).last
|
15
17
|
end
|
16
18
|
|
17
19
|
def data
|
18
|
-
self.raw_data.present? && Marshal.load(
|
20
|
+
self.raw_data.present? && Marshal.load(Base64.decode64(self.raw_data)) || {}
|
19
21
|
end
|
20
22
|
|
21
23
|
def data=(raw)
|
22
24
|
raw ||= {}
|
23
|
-
self.raw_data =
|
25
|
+
self.raw_data = Base64.encode64(Marshal.dump(raw))
|
24
26
|
end
|
25
27
|
|
26
28
|
def loaded?
|
data/lib/mongoid_sessions.rb
CHANGED