diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-20 10:18:44 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-03 21:24:22 +0200 |
commit | 50215f9525b6b5e3bfe703724b9f68177ed8565d (patch) | |
tree | 1574d048d9da01a941313592bf433431572497b9 /activerecord | |
parent | 5836af8f8b0eb3c569c66792abf50a0485bb6f22 (diff) | |
download | rails-50215f9525b6b5e3bfe703724b9f68177ed8565d.tar.gz rails-50215f9525b6b5e3bfe703724b9f68177ed8565d.tar.bz2 rails-50215f9525b6b5e3bfe703724b9f68177ed8565d.zip |
Rely on Rack::Session stores API for more compatibility across the Ruby world.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/session_store.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index 01cc14b8d6..3fc596e02a 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -288,6 +288,7 @@ module ActiveRecord self.session_class = Session SESSION_RECORD_KEY = 'rack.session.record' + ENV_SESSION_OPTIONS_KEY = Rack::Session::Abstract::ENV_SESSION_OPTIONS_KEY private def get_session(env, sid) @@ -299,7 +300,7 @@ module ActiveRecord end end - def set_session(env, sid, session_data) + def set_session(env, sid, session_data, options) Base.silence do record = get_session_model(env, sid) record.data = session_data @@ -316,12 +317,14 @@ module ActiveRecord sid end - def destroy(env) + def destroy_session(env, session_id, options) if sid = current_session_id(env) Base.silence do get_session_model(env, sid).destroy end end + + generate_sid unless options[:drop] end def get_session_model(env, sid) |