Skip to content

Commit

Permalink
Re-include Enumerable in Array, Hash, Range, and Set to get core_ext …
Browse files Browse the repository at this point in the history
…methods

This is needed as of Ruby 3.3.6.
  • Loading branch information
moveson committed Dec 26, 2024
1 parent 8615759 commit 4b07954
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions lib/core_ext/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4b07954

Please sign in to comment.