Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Missed a file from the previous commit

  • Loading branch information...
commit 43e537b9e8a8e34aaf57cec33cd91574ee5c1459 1 parent e30016c
@josh josh authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 activerecord/lib/active_record/session_store.rb
View
10 activerecord/lib/active_record/session_store.rb
@@ -295,7 +295,7 @@ def get_session(env, sid)
def set_session(env, sid, session_data)
Base.silence do
- record = env[SESSION_RECORD_KEY] ||= find_session(sid)
+ record = get_session_model(env, sid)
record.data = session_data
return false unless record.save
@@ -309,6 +309,14 @@ def set_session(env, sid, session_data)
return true
end
+
+ def get_session_model(env, sid)
+ if env[ENV_SESSION_OPTIONS_KEY][:id].nil?
+ env[SESSION_RECORD_KEY] = find_session(sid)
+ else
+ env[SESSION_RECORD_KEY] ||= find_session(sid)
+ end
+ end
def find_session(id)
@@session_class.find_by_session_id(id) ||
Please sign in to comment.
Something went wrong with that request. Please try again.