diff --git a/config/application.rb b/config/application.rb index f4a8e7354..a0c5f5a7a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -39,6 +39,6 @@ class Application < Rails::Application # # config.eager_load_paths << Rails.root.join("extras") - Dir[Rails.root.join('lib/core_ext/**/*.rb')].each { |file| require file } + Dir[Rails.root.join("lib/core_ext/**/*.rb")].each { |file| require file } end end diff --git a/lib/core_ext/enumerable.rb b/lib/core_ext/enumerable.rb index f48aa6576..5d77a272e 100644 --- a/lib/core_ext/enumerable.rb +++ b/lib/core_ext/enumerable.rb @@ -37,6 +37,9 @@ def group_by_equality(&block) end end -module Enumerable - include CoreExt::Enumerable +Enumerable.include(CoreExt::Enumerable) + +# Re-include Enumerable in classes that include it to ensure core extension methods are included +[Array, Hash, Range, Set].each do |klass| + klass.include Enumerable end