1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #42237 from Shopify/ar-logger-attr

Make ActiveRecord::Base.logger a class_attribute
This commit is contained in:
Jean Boussier 2021-05-19 12:28:23 +02:00 committed by GitHub
commit 811f7471d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,10 @@
* `ActiveRecord::Base.logger` is now a `class_attribute`.
This means it can no longer be accessed directly through `@@logger`, and that setting `logger =`
on a subclass won't change the parent's logger.
*Jean Boussier*
* Add `.asc.nulls_first` for all databases. Unfortunately MySQL still doesn't like `nulls_last`.
*Keenan Brock*

View file

@ -17,7 +17,7 @@ module ActiveRecord
# Accepts a logger conforming to the interface of Log4r which is then
# passed on to any new database connections made and which can be
# retrieved on both a class and instance level by calling +logger+.
mattr_accessor :logger, instance_writer: false
class_attribute :logger, instance_writer: false
##
# :singleton-method: