From c6c33181f0b0e1ed3836a0e476d995354d034cda Mon Sep 17 00:00:00 2001 From: Nicky Peeters Date: Tue, 8 Mar 2011 17:26:11 +0100 Subject: [PATCH 1/3] updated README with proper Rails 3 configuration snippet --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2403137..fddf1c2 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,10 @@ Configuration ============= See lib/redis-session-store.rb for a list of valid options. -Set them using: - - ActionController::Base.session = { - :db => 2, - :expire_after => 120.minutes, - :key_prefix => "myapp:session:" - } - - In your Rails app, throw in an initializer with the following contents and the configuration above: - Rails.application.config.session_store :redis_session_store + YourApp::Application.config.session_store :redis_session_store, + :db => 0, + :expire_after => 10.minutes, + :key_prefix => "your_app:session:" From 382cf2bb7cd6506dc20a0655a614ec9c792faeeb Mon Sep 17 00:00:00 2001 From: Nicky Peeters Date: Tue, 8 Mar 2011 17:47:51 +0100 Subject: [PATCH 2/3] bumped version + gemspec to avoid version conflict with elisehuard/redis-session-store gem --- VERSION | 2 +- rails3-redis2-session-store.gemspec | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index 9e11b32..d15723f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +0.3.2 diff --git a/rails3-redis2-session-store.gemspec b/rails3-redis2-session-store.gemspec index a905cc1..6ef42ab 100644 --- a/rails3-redis2-session-store.gemspec +++ b/rails3-redis2-session-store.gemspec @@ -1,29 +1,30 @@ # Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' +# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{rails3-redis2-session-store} - s.version = "0.3.1" + s.version = "0.3.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Mathias Meyer", "Ivan Porto Carrero"] - s.date = %q{2010-12-07} + s.date = %q{2011-03-08} s.description = %q{A drop-in replacement for e.g. MemCacheStore to store Rails sessions (and Rails sessions only) in Redis.} s.email = %q{ivan@flanders.co.nz} s.extra_rdoc_files = [ "LICENSE", - "README.md" + "README.md" ] s.files = [ "LICENSE", - "README.md", - "Rakefile", - "VERSION", - "lib/redis-session-store.rb" + "README.md", + "Rakefile", + "VERSION", + "lib/redis-session-store.rb" ] s.homepage = %q{http://github.com/casualjim/redis-session-store} + s.rdoc_options = ["--charset=UTF-8"] s.require_paths = ["lib"] s.rubygems_version = %q{1.3.7} s.summary = %q{Rails 3 Redis 2 session store} From 79c7b642891cde11f1911e30c946a6f2f15fc105 Mon Sep 17 00:00:00 2001 From: Jan Minarik Date: Mon, 20 Jun 2011 15:24:48 +0200 Subject: [PATCH 3/3] options are given to set_session in fourth parameter in Rails 3.1 --- lib/redis-session-store.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/redis-session-store.rb b/lib/redis-session-store.rb index 27148c9..8ee5028 100644 --- a/lib/redis-session-store.rb +++ b/lib/redis-session-store.rb @@ -53,8 +53,7 @@ def get_session(env, sid) [sid, session] end - def set_session(env, sid, session_data) - options = env['rack.session.options'] + def set_session(env, sid, session_data, options) expiry = options[:expire_after] || nil @redis.pipelined do