lastomato / mongo_followable

Add follow feature to Mongoid and Mongo_Mapper
MIT License
28 stars 10 forks source link

Deleted documents #9

Open l4u opened 11 years ago

l4u commented 11 years ago

When A follow B, and then B is deleted. There will be a mongoid document not found error when we call A.all_followees

krismartin commented 11 years ago

I had the same issue and my workaround was to make sure that followers of the deleted object are removed after you delete the object.

Using your example, you can do:

b.destroy b.unfollowed_all