Commit cc9e209
Prefer ActiveRecord.default_timezone over per-class accessor (#234)
Calling ar_class.default_timezone on Rails 7.0/7.1 prints
DEPRECATION WARNING: ActiveRecord::Base.default_timezone is
deprecated and will be removed in Rails 7.1. Use
ActiveRecord.default_timezone instead.
even though both accessors return the same value. Switch the order so
that we ask the module-level ActiveRecord.default_timezone first when
it is available (AR 7.0+, and the only accessor left in AR 8.0+) and
only fall back to the per-class accessor on pre-7.0 AR where the
module-level one does not exist.
The test in spec/plsql/schema_spec.rb already exercises the
ActiveRecord.default_timezone path via respond_to?, so coverage is
unchanged.
Fixes #234
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 5ea974a commit cc9e209
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
0 commit comments