Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

return sid in set_session. using @data.

  • Loading branch information...
commit d1cb35477d2cdcbb0d304351ed71a07e634ed7e0 1 parent d993a94
@authorNari authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/sequel-rails/session_store.rb
View
10 lib/sequel-rails/session_store.rb
@@ -47,11 +47,11 @@ def self.name
end
def data
- self[:data] ||= self.class.unmarshal(self[:data]) || {}
+ @data ||= self.class.unmarshal(self[:data]) || {}
end
def marshal_data!
- return false unless self[:data]
+ return false unless @data
self[:data] = self.class.marshal(data)
end
@@ -59,6 +59,10 @@ def before_save
marshal_data!
super
end
+
+ def loaded?
+ @data
+ end
end
SESSION_RECORD_KEY = 'rack.session.record'.freeze
@@ -79,7 +83,7 @@ def set_session(env, sid, session_data)
session = get_session_resource(env, sid)
session.data = session_data
session.updated_at = Time.now if session.modified?
- session.save
+ session.save ? sid : false
end
def get_session_resource(env, sid)
Please sign in to comment.
Something went wrong with that request. Please try again.