From 45a9056cf47afdb1950b1ed64fc715128f0be5ac Mon Sep 17 00:00:00 2001 From: koali-fang Date: Thu, 1 Dec 2016 18:00:38 +0800 Subject: [PATCH] Fix session.id call in Rails 3.2 (#36) --- lib/rucaptcha/controller_helpers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rucaptcha/controller_helpers.rb b/lib/rucaptcha/controller_helpers.rb index 92cf1be..a76488f 100644 --- a/lib/rucaptcha/controller_helpers.rb +++ b/lib/rucaptcha/controller_helpers.rb @@ -8,7 +8,8 @@ module RuCaptcha # session key of rucaptcha def rucaptcha_sesion_key_key - ['rucaptcha-session', session.id].join(':') + session_id = session.respond_to?(:id) ? session.id : session[:session_id] + ['rucaptcha-session', session_id].join(':') end # Generate a new Captcha