Closed jedsonmelo closed 4 years ago
Add observer in favoriteable model to delete favorites when deleted.
If model favoriteable is favorited by a user and it is deleted it may cause exceptions in Favoriteability's methods as a favorite(class_name)
favorite(class_name)
added one article as a favorite for two users and deleted the article and see if the records have been deleted from favorites table.
What types of changes does your code introduce?
Description
Add observer in favoriteable model to delete favorites when deleted.
Motivation and context
If model favoriteable is favorited by a user and it is deleted it may cause exceptions in Favoriteability's methods as a
favorite(class_name)
How has this been tested?
added one article as a favorite for two users and deleted the article and see if the records have been deleted from favorites table.
Types of changes
What types of changes does your code introduce?
Checklist: