mirror of https://github.com/rails/rails
Merge pull request #42995 from Shopify/internal-metadata-timestamps
Set record_timestamps = true in AR::InternalMetadata
This commit is contained in:
commit
ea2c5ec0b9
|
@ -1,3 +1,10 @@
|
|||
* Fix `ActiveRecord::InternalMetadata` to not be broken by `config.active_record.record_timestamps = false`
|
||||
|
||||
Since the model always create the timestamp columns, it has to set them, otherwise it breaks
|
||||
various DB management tasks.
|
||||
|
||||
Fixes #42983
|
||||
|
||||
* Add `ActiveRecord::QueryLogs`.
|
||||
|
||||
Configurable tags can be automatically added to all SQL queries generated by Active Record.
|
||||
|
|
|
@ -10,6 +10,8 @@ module ActiveRecord
|
|||
# This is enabled by default. To disable this functionality set
|
||||
# `use_metadata_table` to false in your database configuration.
|
||||
class InternalMetadata < ActiveRecord::Base # :nodoc:
|
||||
self.record_timestamps = true
|
||||
|
||||
class << self
|
||||
def enabled?
|
||||
ActiveRecord::Base.connection.use_metadata_table?
|
||||
|
|
Loading…
Reference in New Issue