Skip to content

ActiveSupport::BufferedLogger can be subclassed #8607

Merged
merged 1 commit into from Dec 25, 2012

2 participants

@senny
Ruby on Rails member
senny commented Dec 25, 2012

Since ActiveSupport::BufferedLogger was deprecated, it's not possible to subclass it anymore. Creating a subclass fails with the following exception:

test_can_be_subclassed(BufferedLoggerTest):
TypeError: superclass must be a Class (ActiveSupport::Deprecation::DeprecatedConstantProxy given)
    test/deprecation/buffered_logger_test.rb:11:in `initialize'
    test/deprecation/buffered_logger_test.rb:11:in `new'
    test/deprecation/buffered_logger_test.rb:11:in `test_can_be_subclassed'

This PR applies the same solution we used for ActiveSupport::BasicObject in #8518

There is a difference to BasicObject, which was only subclassed. There could be applications using BufferedLogger instances and I think this should also result in deprecation warnings. I'm not sure how BufferedLogger was used but I'll happily update the PR when we know what else we need to deprecate.

This is a fix for #8576

@rafaelfranca rafaelfranca merged commit 95fa0e6 into rails:master Dec 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.