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
When a friend or friendable is destroyed it should destroy all its friendships too. It works out of the box on the friendable relation but not on the friend one
Here is a set of specs illustrating the problem:
context"Callbacks"dolet(:friend){create:user}let(:friendable){create:user}let!(:friendship){HasFriendship::Friendship.create(friend: friend,friendable: friendable,status: "accepted")}it"destroys friendship on friend destroy"do# Spec doesn't pass :(expect{friend.destroy}.tochange{HasFriendship::Friendship.count}.by(-1)endit"destroys friendship on friendable destroy"do# Spec succeedsexpect{friendable.destroy}.tochange{HasFriendship::Friendship.count}.by(-1)endend
I will try to submit a PR if I can find time to work on this
The text was updated successfully, but these errors were encountered:
When a
friend
orfriendable
is destroyed it should destroy all its friendships too. It works out of the box on thefriendable
relation but not on thefriend
oneHere is a set of specs illustrating the problem:
I will try to submit a PR if I can find time to work on this
The text was updated successfully, but these errors were encountered: