From 299445d20ea27c3716d68676e4493f72be2c6114 Mon Sep 17 00:00:00 2001 From: Jonathan Gutschi Date: Tue, 23 Apr 2024 13:41:36 +0200 Subject: [PATCH] Fix Time formatting deprecation warnings in Rails 7.0.0+, use time.to_fs instead of time.to_s; see https://apidock.com/rails/v7.0.0/Time/to_s --- app/models/action_smser/delivery_report.rb | 2 +- app/views/action_smser/delivery_reports/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/action_smser/delivery_report.rb b/app/models/action_smser/delivery_report.rb index d84efc4..6a9a23e 100644 --- a/app/models/action_smser/delivery_report.rb +++ b/app/models/action_smser/delivery_report.rb @@ -27,7 +27,7 @@ def self.create_from_sms(sms, to, sms_id) def status=(stat, skip_log = false) self[:status] = stat self.status_updated_at = Time.now - add_log("#{Time.now.to_s(:db)}: #{stat}") unless skip_log + add_log("#{Time.now.to_fs(:db)}: #{stat}") unless skip_log end def add_log(str) diff --git a/app/views/action_smser/delivery_reports/index.html.erb b/app/views/action_smser/delivery_reports/index.html.erb index af0eeaf..ee1110f 100644 --- a/app/views/action_smser/delivery_reports/index.html.erb +++ b/app/views/action_smser/delivery_reports/index.html.erb @@ -39,7 +39,7 @@

Delivery Reports Summary for - (<%= "#{time_span.first.to_s(:db)} => #{time_span.last.to_s(:db)}" %>) + (<%= "#{time_span.first.to_fs(:db)} => #{time_span.last.to_fs(:db)}" %>) <%= "for #{params[:gateway]}" unless params[:gateway].blank? %>