This project is archived and is in readonly mode.

#1984 ✓invalid
Kieran P

'Redirected to' string in logs hash.to_s

Reported by Kieran P | February 16th, 2009 @ 04:36 AM | in 2.x

I'm seeing this in the logs:

Redirected to actionlogincontrolleraccounturlified_namesite

As you can see, the location hash is being printed, but as a string (which isn't formatted properly till Ruby 1.9).

Perhaps add something like:

if RUBY_VERSION < '1.9'
  class Hash
    def to_s
      self.inspect
    end
  end
end

Or change the print to use .inspect.

Comments and changes to this ticket

  • Kieran P

    Kieran P February 16th, 2009 @ 04:38 AM

    diff --git a/vendor/rails/actionpack/lib/action_controller/base.rb b/vendor/rails/actionpack/lib/action_controller/base.rb

    index 36b80d5..ff4c26d 100644
    --- a/vendor/rails/actionpack/lib/action_controller/base.rb
    +++ b/vendor/rails/actionpack/lib/action_controller/base.rb
    @@ -1072,7 +1072,7 @@ module ActionController #:nodoc:
             end
    
             response.redirected_to = options
    -        logger.info("Redirected to #{options}") if logger && logger.info?
    +        logger.info("Redirected to #{options.inspect}") if logger && logger.info?
    
             case options
               # The scheme name consist of a letter followed by any combination of
    
    
  • Pratik

    Pratik March 8th, 2009 @ 01:29 PM

    • Assigned user set to “Pratik”
    • State changed from “new” to “incomplete”

    Could you please submit a failing test case ? actionpack/test/controller/logging_test.rb would be the place to put the test.

    Thanks !

  • Kieran P

    Kieran P March 8th, 2009 @ 11:52 PM

    As of Rails 2.3 RC2, this issue is no longer valid (the code has changed from outputting a options hash or url string to always a url string (which makes debugging easier). Please close as fixed/invalid.

  • Pratik

    Pratik March 9th, 2009 @ 12:04 AM

    • State changed from “incomplete” to “invalid”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages