Fix unqualified column references.

Fix various places to avoid unqualified column references to prevent any
potential ambiguous column errors.
This commit is contained in:
evazion
2022-03-01 17:48:16 -06:00
parent 036341d8ba
commit ad3f3fdce3
8 changed files with 15 additions and 15 deletions

View File

@@ -65,7 +65,7 @@ class Comment < ApplicationRecord
end
def update_last_commented_at_on_destroy
other_comments = Comment.where("post_id = ? and id <> ?", post_id, id).order("id DESC")
other_comments = Comment.where("post_id = ? and id <> ?", post_id, id).order(id: :desc)
if other_comments.count == 0
Post.where(:id => post_id).update_all(:last_commented_at => nil)
else