Fix error when favgroup doesn't exist
This commit is contained in:
@@ -314,8 +314,10 @@ class PostQueryBuilder
|
|||||||
|
|
||||||
if q[:favgroup].present?
|
if q[:favgroup].present?
|
||||||
favgroup_id = q[:favgroup].to_i
|
favgroup_id = q[:favgroup].to_i
|
||||||
post_ids = FavoriteGroup.find(favgroup_id).post_id_array
|
favgroup = FavoriteGroup.where("favorite_groups.id = ?", favgroup_id).first
|
||||||
relation = relation.where("posts.id in (?)", post_ids)
|
if favgroup
|
||||||
|
relation = relation.where("posts.id in (?)", favgroup.post_id_array)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if q[:ordfav].present?
|
if q[:ordfav].present?
|
||||||
|
|||||||
Reference in New Issue
Block a user