Follow up - ca56de3648 - Maintenance: Updated to Rails 6.0.4 and the new Zeitwerk autoloader: Removed workaround/backport of ActiveJob time serialization which is shipped with Rails 6.

This commit is contained in:
Thorsten Eckel 2021-07-13 13:03:30 +02:00
parent fed5016d86
commit 84b654ea0f

View file

@ -1,47 +0,0 @@
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
# Required workaround to serialize ActiveSupport::TimeWithZone, Time, Date and DateTime for ActiveJob
# until Rails 6 is used. See:
# - https://github.com/rails/rails/issues/18519
# - https://github.com/rails/rails/pull/32026
# - https://github.com/rails/rails/tree/6-0-stable/activejob/lib/active_job/serializers
class ActiveSupport::TimeWithZone
include GlobalID::Identification
alias id iso8601
def self.find(iso8601)
Time.iso8601(iso8601).in_time_zone
end
end
class Time
include GlobalID::Identification
alias id iso8601
def self.find(iso8601)
Time.iso8601(iso8601)
end
end
class Date
include GlobalID::Identification
alias id iso8601
def self.find(iso8601)
Date.iso8601(iso8601)
end
end
class DateTime
include GlobalID::Identification
alias id iso8601
def self.find(iso8601)
DateTime.iso8601(iso8601)
end
end