DEV: Replace Rails ends_with? with Ruby end_with? (PR #12507)

ActiveSupport is no longer available in application.rb starting from Ruby 6.1, but application.rb calls the plugin API that uses ends_with? and it causes problems. This commit uses Ruby’s end_with? instead.

GitHub