From 07392f50d4e673e09ed525c9df502c05cb0af2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luis=20Leal=20Cardoso=20Junior?= Date: Sat, 6 Feb 2021 10:51:46 -0300 Subject: [PATCH] Remove unused requires on lib/active_record/associations.rb "active_support/core_ext/string/conversions" was added on https://github.com/rails/rails/commit/3f1cdb85b80b935791018e59161e527617af6f1f for `constantize`. Also, "active_support/core_ext/string/conversions" does not define `constantize` anymore. "active_support/core_ext/enumerable" was added on https://github.com/rails/rails/commit/ea290e77e6c50b13a0c9000eceaa5412de6918bc for `index_by`. Moved the require to 'lib/active_record/associations/collection_association.rb' where it's still used Both usages of `index_by` and `constantize` at this file were removed at https://github.com/rails/rails/commit/52f8e4b9dae6137fcd95793dffc26ddff80b623e#diff-7c2226b7a4aa7f86f7d9e5e16b10686056c02efc725a60e378b5f9d7e52e8403 --- activerecord/lib/active_record/associations.rb | 3 --- .../lib/active_record/associations/collection_association.rb | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 94ce4704fb..73b884474a 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require "active_support/core_ext/enumerable" -require "active_support/core_ext/string/conversions" - module ActiveRecord class AssociationNotFoundError < ConfigurationError #:nodoc: attr_reader :record, :association_name diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 51726c5adc..29ef11475f 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "active_support/core_ext/enumerable" + module ActiveRecord module Associations # = Active Record Association Collection