FIX: Use present? instead of invalid exists? (#869)

This commit is contained in:
Rafael dos Santos Silva 2024-10-25 13:04:42 -03:00 committed by GitHub
parent a2b1ea3c63
commit 8ded4b2e58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ module DiscourseAi
SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0 && post.topic SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0 && post.topic
hot_score = TopicHotScore.find_by(topic: post.topic) hot_score = TopicHotScore.find_by(topic: post.topic)
if hot_score.exists? && hot_score.updated_at > 1.day.ago if hot_score.present? && hot_score.updated_at > 1.day.ago
Jobs.enqueue(:update_hot_topic_gist, topic_id: post&.topic_id) Jobs.enqueue(:update_hot_topic_gist, topic_id: post&.topic_id)
end end
end end