[go: nahoru, domu]

Skip to content

Commit

Permalink
Rename :rails deprecator as :railties
Browse files Browse the repository at this point in the history
Follow-up to rails#46049 and rails#47354.

Since `Rails.deprecator` is now a new `ActiveSupport::Deprecation`
instance instead of `ActiveSupport::Deprecation.instance`, it makes
sense to register it as `Rails.application.deprecators[:railties]`
instead of `Rails.application.deprecators[:rails]`.
  • Loading branch information
jonathanhefner authored and danielvdao committed May 1, 2023
1 parent fa65af1 commit e33d292
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions railties/lib/rails/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,9 @@ def message_verifier(verifier_name)
# The collection's configuration methods affect all deprecators in the
# collection. Additionally, the collection's +silence+ method silences all
# deprecators in the collection for the duration of a given block.
#
# The collection is prepopulated with a default deprecator, which can be
# accessed via <tt>deprecators[:rails]</tt>. More deprecators can be added
# via <tt>deprecators[name] = deprecator</tt>.
def deprecators
@deprecators ||= ActiveSupport::Deprecation::Deprecators.new.tap do |deprecators|
deprecators[:rails] = Rails.deprecator
deprecators[:railties] = Rails.deprecator
end
end

Expand Down
2 changes: 1 addition & 1 deletion railties/test/application/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4022,7 +4022,7 @@ def new(app); self; end
assert_equal ActiveRecord.deprecator, Rails.application.deprecators[:active_record]
assert_equal ActiveStorage.deprecator, Rails.application.deprecators[:active_storage]
assert_equal ActiveSupport.deprecator, Rails.application.deprecators[:active_support]
assert_equal Rails.deprecator, Rails.application.deprecators[:rails]
assert_equal Rails.deprecator, Rails.application.deprecators[:railties]
end

test "can entirely opt out of deprecation warnings" do
Expand Down

0 comments on commit e33d292

Please sign in to comment.