Fixed has_one excessive query.

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 4.0.0 final
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It really fixes https://github.com/mongoid/mongoid/issues/2701

      The problem is that there seems to be no way for a has_one setter to know, whether assigned object is the same without actually getting the object from DB; so I reversed your path and solved the problem in belongs_to setter. I'm not sure that I did it the best way, but at least I didn't break any existing specs and added one spec to cover the bug.

              Assignee:
              Arthur Nogueira Neves
              Reporter:
              Yuriy Trofimenko
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: