From 00ce7249a5f88018d0b650c83ee08df3a45b17d8 Mon Sep 17 00:00:00 2001 From: Stuart Chinery Date: Tue, 10 Dec 2024 08:12:28 +0000 Subject: [PATCH] Removed unnecessary safe chaining --- lib/logga/active_record.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logga/active_record.rb b/lib/logga/active_record.rb index 6344fad..c0e9a10 100644 --- a/lib/logga/active_record.rb +++ b/lib/logga/active_record.rb @@ -80,13 +80,13 @@ def config_excluded_suffixes end def create_log_entry(entry) - log_receiver&.log_entries&.create(entry) + log_receiver.log_entries&.create(entry) end def creation_at return Time.current unless log_receiver == self - (log_receiver&.log_entries&.order(:created_at)&.first&.created_at || Time.current) - 0.1.seconds + (log_receiver.log_entries.order(:created_at).first&.created_at || Time.current) - 0.1.seconds end def default_creation_log_body(record)