-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: 9.0.0, 8.1.5
-
Component/s: Persistence
-
Ruby Drivers
Mongoid::Persistable::LIST_OPERATIONS is referenced in only one place: Mongoid::AtomicPreparer.mongoize_for. Here, it supposedly checks the operator that mongoization is being performed for to see if it is one of the given list operations.
However, mongoize_for is only called from AtomicPreparer.prepare and AtomicPreparer.value_for, and in both cases, the relevant list operations are already being filtered out. I don't believe it is possible for a list operation to ever reach the condition in mongize_for that references LIST_OPERATIONS.
I believe this condition (and the LIST_OPERATIONS constant) is stale code and can be removed, but we should do a proper investigation to confirm that.