This project is archived and is in readonly mode.
Deprecations and dependencies logger and controller failsafe_logger errors
Reported by Rob Anderton | December 11th, 2008 @ 11:29 PM
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.
Comments and changes to this ticket
-
Frederick Cheung December 12th, 2008 @ 11:09 AM
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)
-
Rob Anderton December 14th, 2008 @ 04:12 PM
- 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
-
josh December 15th, 2008 @ 12:42 AM
- Milestone cleared.
- Assigned user set to josh
- State changed from new to open
-
Repository December 15th, 2008 @ 05:49 PM
- State changed from open to resolved
(from [7c18518105e98ccfd89fe64194ede27824dfe8b3]) Properly parenthasize calls to defined?(Rails) in 75fa82418 [#1563 state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...
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
Attachments
Referenced by
- 1563 Deprecations and dependencies logger and controller failsafe_logger errors (from [7c18518105e98ccfd89fe64194ede27824dfe8b3]) Properl...