Skip to content

Fix: global Array monkeypatch conflict - #22

Merged
tavrelkate merged 2 commits into
mainfrom
fix/array-wrap-monkeypatch
Sep 6, 2026
Merged

tavrelkate merged 2 commits into
mainfrom
fix/array-wrap-monkeypatch

Conversation

@tavrelkate

@tavrelkate tavrelkate commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Fixes #21.

The gem no longer touches Array globally. Wrapping values into an array without ever dropping it, including nil, is a rule specific to JsonLogic itself. Now it is scoped inside JsonLogic::Semantics. Every operation file already activates Semantics for operators, so this needs no extra setup anywhere.

require "json_logic"

Array.respond_to?(:wrap)
# 0.3.0 => false

ActiveSupport's own Array.wrap is no longer shadowed:

require "active_support/core_ext/array/wrap"
require "json_logic"

Array.wrap(nil)
# 0.3.0 => [] (ActiveSupport's behavior)

@tavrelkate tavrelkate self-assigned this Sep 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6962f0e2ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md Outdated
@tavrelkate
tavrelkate merged commit 20c59d9 into main Sep 6, 2026
10 checks passed
@tavrelkate
tavrelkate deleted the fix/array-wrap-monkeypatch branch September 10, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Array.wrap

1 participant