FEATURE: Can create warnings for users via PM

This commit is contained in:
Robin Ward
2014-09-05 15:40:25 -04:00
parent a8e4c4caa1
commit b0bfc1f93f
37 changed files with 243 additions and 18 deletions

View File

@ -165,7 +165,7 @@ class TopicQuery
options.reverse_merge!(per_page: SiteSetting.topics_per_page)
# Start with a list of all topics
result = Topic.includes(:allowed_users)
result = Topic.includes(:allowed_users).includes(:warning)
.where("topics.id IN (SELECT topic_id FROM topic_allowed_users WHERE user_id = #{user.id.to_i})")
.joins("LEFT OUTER JOIN topic_users AS tu ON (topics.id = tu.topic_id AND tu.user_id = #{user.id.to_i})")
.order(TopicQuerySQL.order_nocategory_basic_bumped)