mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-08 06:32:46 +00:00
Restrict tags and categories to user visibility level
This commit is contained in:
parent
6a7efb7f0c
commit
824d4a426b
@ -23,6 +23,7 @@ module DiscourseRewind
|
|||||||
.joins("INNER JOIN categories ON categories.id = topics.category_id")
|
.joins("INNER JOIN categories ON categories.id = topics.category_id")
|
||||||
.where(user: user)
|
.where(user: user)
|
||||||
.where(viewed_at: date)
|
.where(viewed_at: date)
|
||||||
|
.where(categories: { id: user.guardian.allowed_category_ids })
|
||||||
.group("categories.id, categories.name")
|
.group("categories.id, categories.name")
|
||||||
.order("COUNT(*) DESC")
|
.order("COUNT(*) DESC")
|
||||||
.limit(5)
|
.limit(5)
|
||||||
|
@ -25,6 +25,7 @@ module DiscourseRewind
|
|||||||
.joins("INNER JOIN tags ON tags.id = topic_tags.tag_id")
|
.joins("INNER JOIN tags ON tags.id = topic_tags.tag_id")
|
||||||
.where(user: user)
|
.where(user: user)
|
||||||
.where(viewed_at: date)
|
.where(viewed_at: date)
|
||||||
|
.where(tags: { id: Tag.visible(user.guardian).pluck(:id) })
|
||||||
.group("tags.id, tags.name")
|
.group("tags.id, tags.name")
|
||||||
.order("COUNT(DISTINCT topic_views.topic_id) DESC")
|
.order("COUNT(DISTINCT topic_views.topic_id) DESC")
|
||||||
.limit(5)
|
.limit(5)
|
||||||
|
@ -26,7 +26,7 @@ module DiscourseRewind
|
|||||||
Action::ReadingTime,
|
Action::ReadingTime,
|
||||||
Action::Reactions,
|
Action::Reactions,
|
||||||
Action::Fbff,
|
Action::Fbff,
|
||||||
# Action::FavoriteTags,
|
Action::FavoriteTags,
|
||||||
Action::FavoriteCategories,
|
Action::FavoriteCategories,
|
||||||
Action::BestTopics,
|
Action::BestTopics,
|
||||||
Action::BestPosts,
|
Action::BestPosts,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user