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

Change #attributes return value to Hash with a flag

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.0.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible

      In https://jira.mongodb.org/browse/MONGOID-5344 the return value of #attributes was changed to always be a Hash. Previously it was a BSON::Document if the model instance was retrieved from the database using #find.

      AR has its attributes as a Hash and does not permit indifferent access, therefore the change in https://jira.mongodb.org/browse/MONGOID-5344 I believe is correct. However it does require a flag because it is a breaking change.

      https://jira.mongodb.org/browse/MONGOID-5362 is related to this ticket, but unlike the tests which should be backported as far back in 7.x as is practical the return value should only be changed in 7.5/8.0.

            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: