From 00895e03cc708ef4b15839273f437b5505c79f7a Mon Sep 17 00:00:00 2001 From: Christian Sutter Date: Fri, 6 Oct 2023 14:24:19 +0000 Subject: [PATCH] Use `Time.parse` for document timestamps Rubocop prefers Rails's `Time.zone.parse` over Ruby's `Time.parse`, but this is actually counterproductive here as the `public_updated_at` timestamp contains a timezone which shouldn't get lost (and using the Rails zoned time couples us to Rails). --- lib/document_sync_worker/document/publish.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/document_sync_worker/document/publish.rb b/lib/document_sync_worker/document/publish.rb index 4ad0982..98c41f8 100644 --- a/lib/document_sync_worker/document/publish.rb +++ b/lib/document_sync_worker/document/publish.rb @@ -68,7 +68,7 @@ def public_timestamp def public_timestamp_int return nil unless public_timestamp - Time.zone.parse(public_timestamp).to_i + Time.parse(public_timestamp).to_i # rubocop:disable Rails/TimeZone (string contains TZ info) end end end