Skip to content

Commit 095b1f1

Browse files
Use dedicated deprecator in deprecation example [ci-skip]
1 parent bc3887e commit 095b1f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/contributing_to_ruby_on_rails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ If your breaking change removes existing behavior, you'll first need to add a
534534
deprecation warning while keeping the existing behavior.
535535

536536
As an example, let's say you want to remove a public method on
537-
ActiveRecord::Base. If the main branch points to the unreleased 7.0 version,
537+
`ActiveRecord::Base`. If the main branch points to the unreleased 7.0 version,
538538
Rails 7.0 will need to show a deprecation warning. This makes sure anyone
539539
upgrading to any Rails 7.0 version will see the deprecation warning.
540540
In Rails 7.1 the method can be deleted.
@@ -543,7 +543,7 @@ You could add the following deprecation warning:
543543

544544
```ruby
545545
def deprecated_method
546-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
546+
ActiveRecord.deprecator.warn(<<-MSG.squish)
547547
`ActiveRecord::Base.deprecated_method` is deprecated and will be removed in Rails 7.1.
548548
MSG
549549
# Existing behavior

0 commit comments

Comments
 (0)