提交 7c9e69db 编写于 作者: A Alberto Almagro

Document missing supported types [ci skip]

This commit adds missing types to the supported types list, which
was extended in #30941
上级 ef4f5ef6
...@@ -14,11 +14,14 @@ def initialize #:nodoc: ...@@ -14,11 +14,14 @@ def initialize #:nodoc:
end end
# Raised when an unsupported argument type is set as a job argument. We # Raised when an unsupported argument type is set as a job argument. We
# currently support NilClass, Integer, Float, String, TrueClass, FalseClass, # currently support String, Integer, Float, NilClass, TrueClass, FalseClass,
# BigDecimal, and objects that can be represented as GlobalIDs (ex: Active Record). # BigDecimal, Symbol, Date, Time, DateTime, ActiveSupport::TimeWithZone,
# ActiveSupport::Duration, Hash, ActiveSupport::HashWithIndifferentAccess,
# Array or GlobalID::Identification instances, although this can be extended
# by adding custom serializers.
# Raised if you set the key for a Hash something else than a string or # Raised if you set the key for a Hash something else than a string or
# a symbol. Also raised when trying to serialize an object which can't be # a symbol. Also raised when trying to serialize an object which can't be
# identified with a Global ID - such as an unpersisted Active Record model. # identified with a GlobalID - such as an unpersisted Active Record model.
class SerializationError < ArgumentError; end class SerializationError < ArgumentError; end
module Arguments module Arguments
......
...@@ -9,10 +9,12 @@ module Enqueuing ...@@ -9,10 +9,12 @@ module Enqueuing
# Includes the +perform_later+ method for job initialization. # Includes the +perform_later+ method for job initialization.
module ClassMethods module ClassMethods
# Push a job onto the queue. The arguments must be legal JSON types # Push a job onto the queue. By default the arguments must be either String,
# (+string+, +int+, +float+, +nil+, +true+, +false+, +hash+ or +array+) or # Integer, Float, NilClass, TrueClass, FalseClass, BigDecimal, Symbol, Date,
# GlobalID::Identification instances. Arbitrary Ruby objects # Time, DateTime, ActiveSupport::TimeWithZone, ActiveSupport::Duration,
# are not supported. # Hash, ActiveSupport::HashWithIndifferentAccess, Array or
# GlobalID::Identification instances, although this can be extended by adding
# custom serializers.
# #
# Returns an instance of the job class queued with arguments available in # Returns an instance of the job class queued with arguments available in
# Job#arguments. # Job#arguments.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册