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

Changeset 117

Show
Ignore:
Timestamp:
12/12/04 12:43:48 (4 years ago)
Author:
david
Message:

Fixed CgiRequest so that it'll now accept session options with Symbols as keys (as the documentation points out) [Suggested by Andreas]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r115 r117  
    11*SVN* 
     2 
     3* Fixed CgiRequest so that it'll now accept session options with Symbols as keys (as the documentation points out) [Suggested by Andreas] 
     4 
     5* Added that render_partial will always by default include a counter with value 1 unless there is a counter passed in via the  
     6  local_assigns hash that overrides it. As a result, render_collection_of_partials can still be written in terms of render_partial 
     7  and partials that make use of a counter can be called without problems from both render_collection_of_partials as well as 
     8  render_partial #295 [marcel] 
    29 
    310* Fixed CgiRequest#out to fall back to #write if $stdout doesn't have #syswrite [bitsweat] 
     
    120127 
    121128* Fixed that link_to would escape & in the url again after url_for already had done so 
     129 
    122130 
    123131*0.9.5* (28) 
  • trunk/actionpack/lib/action_controller/cgi_process.rb

    r61 r117  
    3737 
    3838    DEFAULT_SESSION_OPTIONS = 
    39       { "database_manager" => CGI::Session::PStore, "prefix" => "ruby_sess.", "session_path" => "/" } 
     39      { :database_manager => CGI::Session::PStore, :prefix => "ruby_sess.", :session_path => "/" } 
    4040 
    4141    def initialize(cgi, session_options = {}) 
     
    6868      return @session unless @session.nil? 
    6969      begin 
    70         @session = (@session_options == false ? {} : CGI::Session.new(@cgi, DEFAULT_SESSION_OPTIONS.merge(@session_options))) 
     70        @session = (@session_options == false ? {} : CGI::Session.new(@cgi, session_options_with_string_keys)) 
    7171        @session["__valid_session"] 
    7272        return @session 
     
    9494      def new_session 
    9595        CGI::Session.new(@cgi, DEFAULT_SESSION_OPTIONS.merge(@session_options).merge("new_session" => true)) 
     96      end 
     97       
     98      def session_options_with_string_keys 
     99        DEFAULT_SESSION_OPTIONS.merge(@session_options).inject({}) { |options, pair| options[pair.first.to_s] = pair.last; options } 
    96100      end 
    97101  end 
  • trunk/actionpack/lib/action_controller/cookies.rb

    r110 r117  
    4242    def []=(name, options) 
    4343      if options.is_a?(Hash) 
    44         options.each { |key, value| options[key.to_s] = value
     44        options = options.inject({}) { |options, pair| options[pair.first.to_s] = pair.last; options
    4545        options["name"] = name.to_s 
    4646      else