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

Document "readonly" state not reset after reload

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.1
    • Affects Version/s: None
    • Component/s: None
    • None

      I load a document with only or without, then I realize I'll need to persist it, so I reload it. The missing attributes are loaded now, but the document still appears as read-only and cannot be saved.

      Example:

      f = Fund.without(:prices).find('5167f7dc0ea8c8affc0005b2')
      p f.readonly?, f.__selected_fields, f.prices.count
      f.reload
      p f.readonly?, f.__selected_fields, f.prices.count
      

      Output:

      true
      {"prices"=>0}
      0
      true
      {"prices"=>0}
      1010
      

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            stanley90x Marek Stanczyk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: