mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Refactor code that raises deprecating warnings in Rails 4
This commit is contained in:
@@ -23,7 +23,7 @@ class UserBlocker
|
||||
def hide_posts
|
||||
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.update_all({ visible: false }, id: topic_ids) unless topic_ids.empty?
|
||||
Topic.where(id: topic_ids).update_all({ visible: false }) unless topic_ids.empty?
|
||||
end
|
||||
|
||||
def unblock
|
||||
|
||||
Reference in New Issue
Block a user