Fixed incorrect showing of favorites
- Moved all favorite checking logic to same file
This commit is contained in:
@@ -400,12 +400,6 @@ class PostQueryBuilder
|
||||
|
||||
if q[:ordfav].present?
|
||||
user_id = q[:ordfav].to_i
|
||||
user = User.find(user_id)
|
||||
|
||||
if user.hide_favorites?
|
||||
raise User::PrivilegeError.new
|
||||
end
|
||||
|
||||
relation = relation.joins("INNER JOIN favorites ON favorites.post_id = posts.id")
|
||||
relation = relation.where("favorites.user_id % 100 = ? and favorites.user_id = ?", user_id % 100, user_id).order("favorites.id DESC")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user