-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:
I have the following:
class User has_and_belongs_to_many :followers, class_name: 'User', inverse_of: :following has_and_belongs_to_many :following, class_name: 'User', inverse_of: :followers end
when I do user.following.delete(following_user) I expect that the id is removed from both user.following_ids and following_user.follower_ids.
What I'm seeing is the id still remains in following_user.follower_ids. That is, it's removing the reference correctly from following, but not doing it likewise on followers.
From what I understand from the docs, calling delete should orphan the child, and with nullify as the default dependent behaviour on the inverse side, it should do likewise to that too.
Is this a bug or am I missing something?
Using mongoid 2.4.9 and ruby 1.9.3.