Skip to content
This repository
Browse code

Merge [6253] from trunk. References #6680.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@6254 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 9679cb4d979240aacbc3bd8e22a17942627d3414 1 parent 742bee4
Jeremy Kemper authored February 27, 2007
2  actionpack/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* session_enabled? works with session :off.  #6680 [Catfish]
  4
+
3 5
 * Performance: patch cgi/session to require digest/md5 once rather than per #create_new_id.  [Stefan Kaes]
4 6
 
5 7
 
2  actionpack/lib/action_controller/base.rb
@@ -539,7 +539,7 @@ def controller_path
539 539
       end
540 540
 
541 541
       def session_enabled?
542  
-        request.session_options[:disabled] != false
  542
+        request.session_options && request.session_options[:disabled] != false
543 543
       end
544 544
 
545 545
     protected
11  actionpack/test/controller/session_management_test.rb
@@ -142,4 +142,15 @@ def test_process_cleanup_with_session_management_support
142 142
     get :tell
143 143
     assert_equal "does not have cached associations", @response.body
144 144
   end
  145
+  
  146
+  def test_session_is_enabled
  147
+    @controller = TestController.new
  148
+    get :show
  149
+    assert_nothing_raised do
  150
+      assert_equal false, @controller.session_enabled?
  151
+    end
  152
+    
  153
+    get :tell
  154
+    assert @controller.session_enabled?
  155
+  end
145 156
 end

0 notes on commit 9679cb4

Please sign in to comment.
Something went wrong with that request. Please try again.