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:
parent
fed5016d86
commit
84b654ea0f
1 changed files with 0 additions and 47 deletions
|
@ -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
|
Loading…
Reference in a new issue