Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Deprecations and dependencies logger and controller failsafe_logger errors

#1563

The lack of parentheses in the calls to defined? in this commit is causing problems when logging deprecations, for example, the ActiveModel errors class tries to warn about deprecation and causes this error:

private method warn' called for [expression](String)

The backtrace points to:

/vendor/rails/activesupport/lib/active_support/deprecation.rb:17

Adding parentheses to this line fixes the problem:


logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)

Similar changes are also needed in the other files touched by this commit - the fact that this wasn't picked up in the tests also suggests a hole in coverage :)

Sorry I haven't got time to put together a patch, but this should be a fairly quickfix anyway.

Reported by Rob Anderton · December 11th, 2008 @ 11:29 PM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. Frederick Cheung
    Frederick Cheung

    I've patched this and verified it works. Re: test coverage the issue is that tests override the logging to the log file behaviour (in favour of something that makes it easier to assert that the correct deprecation warning was issued)

    December 12th, 2008 @ 11:09 AM

  2. Rob Anderton
    Rob Anderton
    • Tag changed from actioncontroller, active_support, bug to actioncontroller, active_support, bug, patch

    +1 That works for me, thanks.

    Again, apologies for not patching this myself - not being lazy (honest!) just too many pre-christmas deadlines to worry about right now :D

    December 14th, 2008 @ 04:12 PM

  3. josh
    josh
    • Milestone cleared.
    • Assigned user set to josh
    • State changed from new to open

    December 15th, 2008 @ 12:42 AM

  4. Repository
    Repository
    • State changed from open to resolved

    (from [7c18518105e98ccfd89fe64194ede27824dfe8b3]) Properly parenthasize calls to defined?(Rails) in 75fa82418 [#1563 Deprecations and dependencies logger and controller failsafe_logger errors state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    December 15th, 2008 @ 05:49 PM