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

Going from `@attributes` to `attributes` breaks stuff

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

      Commit f2df9224 introduced some incompatibilities with 2.0.1, which are quite hard to track.

      I copied it from my comment:

      While this change is very logical in terms of OO, it introduced some very strange breakage in my application, which I'm currently trying to reproduce in vitro.

      One of the errors, is that in some case when adding document to collection, the flatten implicitly calls to_ary on document, and it fails with NameError. When I do document.inspect beforehand, it works, and that makes me think that attributes are lazy.

      The other, when I use FactoryGirl like this (car is referenced by garage): Factory(:car, :garage => @garage) - it fails validation, as ALL fields of car are empty.

      Do you have any idea how it can be fixed, or how I can help to debug this?

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

              Created:
              Updated:
              Resolved: