Skip to content

馃悶 Bug Report: Conflict between active_record_extended and Rails 7.2+ with_recursive#117

Description

@Antoine-Gerard

Summary:

When using ActiveRecord.with_recursive, an error is raised due to a conflict with ActiveRecordExtended鈥檚 monkey patch that defines method with_values= .

Error Message

undefined` method `with_values=' for nil:NilClass (NoMethodError) 

Cause:
The gem active_record_extended defines a monkey patch that introduces a with_values= method, which collides with internal behavior of ActiveRecord鈥檚 CTE implementation in Rails 7.2+.

This leads to with_values= being called on nil instead of a valid relation or CTE builder, because the method name overlaps with internal expectations.

Steps to reproduce:

1. Use Rails 7.2.1+ with ActiveRecord.with_recursive.
2. Have active_record_extended in your Gemfile.
3. Try using .with_recursive(...) on any model.
4. Observe the crash on with_values=.

Expected behavior:

ActiveRecord鈥檚 with_recursive should work normally when the gem is present.

Actual behavior:

NoMethodError is raised due to an unexpected override of with_values=.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions