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

IdentityMap Troubles

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

      In rails console, with identity_map_enabled: false

      > Book.find(123).series.books.count
      14
      > Book.find(123).series.books.to_a.length
      14
      > Book.find(123).series.books.to_a.length
      14

      With identity_map_enabled: true

      > Book.find(123).series.books.count
      14
      > Book.find(123).series.books.to_a.length
      14
      > Book.find(123).series.books.to_a.length
      16

      My books are reproducing! It looks like one of the books is getting shoved into the second result set multiple times. I'm happy to investigate further if you tell me where to look.

      class Book
        include Mongoid::Document
        belongs_to :series
      end
      
      class Series
        include Mongoid::Document  
        has_many :books
      end
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            gurgeous Adam Doppelt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: