Skip to content

Commit ea2c5ec

Browse files
authored
Merge pull request rails#42995 from Shopify/internal-metadata-timestamps
Set record_timestamps = true in AR::InternalMetadata
2 parents 5e83ad3 + 6fce557 commit ea2c5ec

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

activerecord/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* Fix `ActiveRecord::InternalMetadata` to not be broken by `config.active_record.record_timestamps = false`
2+
3+
Since the model always create the timestamp columns, it has to set them, otherwise it breaks
4+
various DB management tasks.
5+
6+
Fixes #42983
7+
18
* Add `ActiveRecord::QueryLogs`.
29

310
Configurable tags can be automatically added to all SQL queries generated by Active Record.

activerecord/lib/active_record/internal_metadata.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module ActiveRecord
1010
# This is enabled by default. To disable this functionality set
1111
# `use_metadata_table` to false in your database configuration.
1212
class InternalMetadata < ActiveRecord::Base # :nodoc:
13+
self.record_timestamps = true
14+
1315
class << self
1416
def enabled?
1517
ActiveRecord::Base.connection.use_metadata_table?

0 commit comments

Comments
 (0)