fixes #1059
This commit is contained in:
@@ -26,7 +26,13 @@ class UserPresenter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def posts_for_subscription(subscription)
|
def posts_for_subscription(subscription)
|
||||||
Post.where("id in (?)", subscription.post_id_array.slice(0, 6).map(&:to_i)).order("id desc")
|
arel = Post.where("id in (?)", subscription.post_id_array.map(&:to_i)).order("id desc").limit(6)
|
||||||
|
|
||||||
|
if CurrentUser.user.hide_deleted_posts?
|
||||||
|
arel = arel.undeleted
|
||||||
|
end
|
||||||
|
|
||||||
|
arel
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_links_for_subscription(template, subscription)
|
def tag_links_for_subscription(template, subscription)
|
||||||
@@ -60,7 +66,15 @@ class UserPresenter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def favorites
|
def favorites
|
||||||
@favorites ||= user.favorites.limit(6).includes(:post).reorder("favorites.id desc").map(&:post)
|
@favorites ||= begin
|
||||||
|
arel = user.favorites.limit(6).includes(:post).reorder("favorites.id desc")
|
||||||
|
|
||||||
|
if CurrentUser.user.hide_deleted_posts?
|
||||||
|
arel = arel.where("posts.is_deleted = false")
|
||||||
|
end
|
||||||
|
|
||||||
|
arel.map(&:post)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_favorites?
|
def has_favorites?
|
||||||
|
|||||||
Reference in New Issue
Block a user