Add Feature Flag: Reloading retains stale changed value

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • 7.4.0
    • Affects Version/s: None
    • Component/s: Attributes
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      In testing for MONGOID-5199 neil.shweky found the following curious case:

      Band.with_session do |s|
        s.start_transaction
      
        label = Label.new(name: "Neil")
        b = Band.new(label: label)
        b.save!
        b.label = nil
        b.label = label
        b.reload
        puts b.label # nil
      
        s.commit_transaction
      end
      

      This code appears to print a stale changed value, which regardless of whether reload should reset attribute changes does not appear to be correct.

            Assignee:
            Neil Shweky (Inactive)
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: