Commit 138f1a2
authored
Revert introduction of
* Revert introduction of `forwardable`
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.
* Add changelog entry, bump next to minor version
* Add an integration spec showing forwardable regressionforwardable (#107)1 parent 0795445 commit 138f1a2
6 files changed
Lines changed: 31 additions & 6 deletions
File tree
- lib/mongoid
- locker
- spec
- integration/mongoid-history
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | 106 | | |
110 | 107 | | |
111 | 108 | | |
| |||
117 | 114 | | |
118 | 115 | | |
119 | 116 | | |
120 | | - | |
| 117 | + | |
121 | 118 | | |
122 | 119 | | |
123 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
0 commit comments