Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5779

Persistable::LIST_OPERATIONS may not be necessary any more

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: