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

Document "readonly" state not reset after reload

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.1
    • Component/s: None
    • Labels:
      None
    • # Replies:
      7
    • Last comment by Customer:
      true

      Description

      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
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 31 weeks, 6 days ago
                Date of 1st Reply: