favoritescontroller#destroy should work even if the post doesn't exist, remove from favorites on expunge (fixes #3222)
This commit is contained in:
@@ -289,12 +289,12 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def add_favorite!(post)
|
||||
Favorite.add(post, self)
|
||||
Favorite.add(post: post, user: self)
|
||||
clean_favorite_count! if clean_favorite_count?
|
||||
end
|
||||
|
||||
def remove_favorite!(post)
|
||||
Favorite.remove(post, self)
|
||||
Favorite.remove(post: post, user: self)
|
||||
end
|
||||
|
||||
def favorite_groups
|
||||
|
||||
Reference in New Issue
Block a user