Refactor code that raises deprecating warnings in Rails 4

This commit is contained in:
Stephan Kaag
2013-07-03 22:04:22 +02:00
parent cfc4dda9ff
commit 2abfd38aee
3 changed files with 4 additions and 4 deletions

View File

@@ -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