mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Fix update statement for Rails 4 preparation
This commit is contained in:
parent
6364fc74ef
commit
07791ea471
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ class UserBlocker
|
||||||
end
|
end
|
||||||
|
|
||||||
def hide_posts
|
def hide_posts
|
||||||
Post.update_all(["hidden = true, hidden_reason_id = COALESCE(hidden_reason_id, ?)", Post.hidden_reasons[:new_user_spam_threshold_reached]], user_id: @user.id)
|
Post.where(user_id: @user.id).update_all(["hidden = true, hidden_reason_id = COALESCE(hidden_reason_id, ?)", Post.hidden_reasons[:new_user_spam_threshold_reached]])
|
||||||
topic_ids = Post.where('user_id = ? and post_number = ?', @user.id, 1).pluck(:topic_id)
|
topic_ids = Post.where('user_id = ? and post_number = ?', @user.id, 1).pluck(:topic_id)
|
||||||
Topic.update_all({ visible: false }, id: topic_ids) unless topic_ids.empty?
|
Topic.update_all({ visible: false }, id: topic_ids) unless topic_ids.empty?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue