From 138a894d28917a76c65f0785ebd43d6ece53bb5a Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 20 Oct 2023 08:31:57 +1300 Subject: [PATCH] fix: return `nil` if revision time ends up being zero --- variants/backend-base/config/initializers/version.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/variants/backend-base/config/initializers/version.rb b/variants/backend-base/config/initializers/version.rb index 62795b6c..1bd5d783 100644 --- a/variants/backend-base/config/initializers/version.rb +++ b/variants/backend-base/config/initializers/version.rb @@ -13,8 +13,13 @@ raise StandardError unless File.exist?(path) File.read(path).chomp + end.to_i + + if value.zero? + nil + else + Time.zone.at(value).utc end - Time.zone.at(value.to_i).utc rescue StandardError nil end