You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This used to work just fine with Mongoid 3 / mongoid-audit 0.1.7, but once I upgraded to Mongoid 5 / mongoid-audit 1.1.0, I'm getting this error:
Mongoid::Errors::AmbiguousRelationship:
message:
Ambiguous relations :given_gifts, :received_gifts defined on User.
summary:
When Mongoid attempts to set an inverse document of a relation in memory, it needs to know which relation it belongs to. When setting :updater, Mongoid looked on the class Gift for a matching relation, but multiples were found that could potentially match: :given_gifts, :received_gifts.
resolution:
On the :updater relation on Gift you must add an :inverse_of option to specify the exact relationship on User that is the opposite of :updater.
I don't have an :updater relation defined in my model, but I do have include Trackable in my Gift and User model.
I'm not quite sure how to properly define the inverse_of option on the :updater relation, since it's buried away somewhere else. Any idea what I could do to address this?
The text was updated successfully, but these errors were encountered:
ptrikutam
changed the title
AmbiguousRelationship erro
AmbiguousRelationship error
Nov 3, 2015
ptrikutam
changed the title
AmbiguousRelationship error
Mongoid::Errors::AmbiguousRelationship error
Nov 3, 2015
Not sure if this is an issue with
This used to work just fine with Mongoid 3 /
mongoid-audit
0.1.7, but once I upgraded to Mongoid 5 /mongoid-audit
1.1.0, I'm getting this error:I don't have an
:updater
relation defined in my model, but I do haveinclude Trackable
in myGift
andUser
model.I'm not quite sure how to properly define the
inverse_of
option on the:updater
relation, since it's buried away somewhere else. Any idea what I could do to address this?The text was updated successfully, but these errors were encountered: