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

@@ -127,7 +127,7 @@ class ForumPost < ApplicationRecord
end
def update_topic_updated_at_on_delete
max = ForumPost.where(:topic_id => topic.id, :is_deleted => false).order("updated_at desc").first
max = ForumPost.where(topic_id: topic.id, is_deleted: false).order(updated_at: :desc).first
if max
ForumTopic.where(:id => topic.id).update_all(["updated_at = ?, updater_id = ?", max.updated_at, max.updater_id])
end
@@ -140,7 +140,7 @@ class ForumPost < ApplicationRecord
end
def update_topic_updated_at_on_destroy
max = ForumPost.where(:topic_id => topic.id, :is_deleted => false).order("updated_at desc").first
max = ForumPost.where(topic_id: topic.id, is_deleted: false).order(updated_at: :desc).first
if max
ForumTopic.where(:id => topic.id).update_all(["response_count = response_count - 1, updated_at = ?, updater_id = ?", max.updated_at, max.updater_id])
else