Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8407

Show
Ignore:
Timestamp:
12/15/07 02:29:15 (9 months ago)
Author:
bitsweat
Message:

Ruby 1.9 compat: account for new, non-flattening Array#to_s

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/cookies.rb

    r8062 r8407  
    5151      cookie = @cookies[name.to_s] 
    5252      if cookie && cookie.respond_to?(:value) 
    53         cookie.size > 1 ? cookie.value : cookie.value.to_s 
    54       end  
     53        cookie.size > 1 ? cookie.value : cookie.value[0] 
     54      end 
    5555    end 
    5656 
  • trunk/actionpack/test/controller/cookie_test.rb

    r7978 r8407  
    6868    get :authenticate_with_http_only 
    6969    assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "http_only" => true) ], @response.headers["cookie"] 
    70     assert_equal CGI::Cookie::new("name" => "user_name", "value" => "david", "path" => "/", "http_only" => true).to_s, @response.headers["cookie"].to_s 
     70    assert_equal CGI::Cookie::new("name" => "user_name", "value" => "david", "path" => "/", "http_only" => true).to_s, @response.headers["cookie"][0].to_s 
    7171  end 
    7272