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

Remove Document#to_a

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 8.0.1
    • Affects Version/s: None
    • Component/s: None
    • 1
    • Major Change

      Mongoid documents have a `to_a` method on them which return an array containing the document as the only item. https://jira.mongodb.org/browse/MONGOID-4680 shows an example when this behavior creates an infinite loop. Since documents are not arrays or containers in general it does not make sense to me for them to have a to_a method.

      This method has existed since mongoid 1.0 per its docstring, thus its removal would need to happen in the next major version.

      After removing this method, the only failure in the test suite was that of the one test verifying its operation as just described.

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: