Skip to content

Conversation

@scpike
Copy link

@scpike scpike commented Jun 22, 2025

No description provided.

Mongoid 7.1.0 introduced a regression (see
https://jira.mongodb.org/browse/MONGOID-4849) by switching to the
builtin ruby forwardable method of delegation rather than relying on the
ActiveSupport-provided delegation used before.

mongoid-locker was made compatible with the regressed version of mongoid
in mongodb/mongoid#4739

Mongoid then fixed this regression in 7.1.1+ with
mongodb/mongoid@d078acd,
which goes back to the active support way of delegating.

The `forwardable` inclusion in mongoid-locker causes incompatibilities
when you then include another gem that expects to be able to set up a
delegator within a mongoid document class. For example the
`mongoid-history` gem expects to be able to delegate using the
active-support style here:
https://github.com/mongoid/mongoid-history/blob/c8c4de1235c01252dfbdb9fe6c0abfc078ec1443/lib/mongoid/history/trackable.rb#L24-L25

This PR reverts the change to introduce `forwardable`.

See
mongoid/mongoid-history#238 (comment)
for an example of how this interacts poorly with mongoid-history.
@scpike scpike force-pushed the revert-forwardable-inclusion branch from 9f4e509 to a1e5086 Compare June 22, 2025 01:47
@scpike scpike force-pushed the revert-forwardable-inclusion branch from e0b95ae to 794f081 Compare June 22, 2025 02:03
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.

2 participants