Skip to content

Commit

Permalink
fix topic bulk action
Browse files Browse the repository at this point in the history
  • Loading branch information
hooopo committed Nov 20, 2019
1 parent d710b0e commit f41bbd5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/topics_bulk_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ def archive_messages
def dismiss_posts
sql = "
UPDATE topic_users tu
SET highest_seen_post_number = t.highest_post_number , last_read_post_number = highest_post_number
FROM topics t
WHERE t.id = tu.topic_id AND tu.user_id = :user_id AND t.id IN (:topic_ids)
INNER JOIN topics t ON t.id = tu.topic_id AND tu.user_id = :user_id AND t.id IN (:topic_ids)
SET tu.highest_seen_post_number = t.highest_post_number , tu.last_read_post_number = t.highest_post_number
"

DB.exec(sql, user_id: @user.id, topic_ids: @topic_ids)
Expand Down

0 comments on commit f41bbd5

Please sign in to comment.