Permalink
Browse files

hacking in some Rails 3.1 compatibility

  • Loading branch information...
hmcfletch committed Jun 18, 2011
1 parent c85d6c3 commit f3fe5d7dafdfd7c269f2c473f1546a939ecc6337
Showing with 13 additions and 4 deletions.
  1. +2 −2 encrypted-cookie-store.gemspec
  2. +11 −2 lib/encrypted-cookie-store/encrypted_cookie_store.rb
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_dependency('rails', '~> 3.0.0')
s.add_dependency('encrypted-cookies', '~> 0.2')
s.add_dependency('rails', '~> 3.0')
s.add_dependency('encrypted-cookies', '>= 0.3')
end
@@ -15,8 +15,17 @@ def unpacked_cookie_data(env)
end
end

def set_cookie(request, options)
request.cookie_jar.encrypted[@key] = options
if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0
puts "+++ 3.0"
def set_cookie(request, options)
request.cookie_jar.encrypted[@key] = options
end
elsif Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 1
puts "+++ 3.1"
def set_cookie(env, session_id, cookie)
request = ActionDispatch::Request.new(env)
request.cookie_jar.encrypted[@key] = cookie
end
end
end
end

0 comments on commit f3fe5d7

Please sign in to comment.