mongoid/mongoid — Issue #1490: error when adding a relation between an object and itself
Author: digitalplaywright
Created: 2011-12-10 22:30:15+00:00
State: open

Adding a relation between an object and itself adds the relation, but gives a 'stack level too deep error'. On all subsequent operations you get a 'stack level too deep' error.

```

class Space
include Mongoid::Document

references_and_referenced_in_many :friends, :class_name => "Space"
end

space = Space.create()
space.friends << space

```