Add Factory#from_map_or_db for identity map use on criteria based queries

XMLWordPrintableJSON

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

      This pull request adds Factory.from_map_or_db, which will load previously instantiated documents from the identity map before instantiating a new document for a given id. In addition, this pull request changes criteria-based queries and relations to use this new method instead of Factory.from_db. This allows for statements like this to be true:

      Person.find("1").object_id == Person.where(id:"1").first.object_id
      

      This change makes the IdentityMap semantics less complicated, IMO.

              Assignee:
              Unassigned
              Reporter:
              nullstyle
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: