diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-11-12 16:16:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 16:16:01 +0900 |
commit | 1cc46865ecfeed614f36505ac213f364a0231dca (patch) | |
tree | beffc4fc4dd13463019a7c55bd5a2659ecc322e1 /activejob | |
parent | aea9c9a1edee8153cdc24c518803a9d48bf78657 (diff) | |
parent | 7c9e69dba1238441c9094983b334ee6d313e3820 (diff) | |
download | rails-1cc46865ecfeed614f36505ac213f364a0231dca.tar.gz rails-1cc46865ecfeed614f36505ac213f364a0231dca.tar.bz2 rails-1cc46865ecfeed614f36505ac213f364a0231dca.zip |
Merge pull request #34414 from albertoalmagro/include-big-decimal-as-supported-type
Document missing supported types [ci skip]
Diffstat (limited to 'activejob')
-rw-r--r-- | activejob/lib/active_job/arguments.rb | 9 | ||||
-rw-r--r-- | activejob/lib/active_job/enqueuing.rb | 10 |
2 files changed, 12 insertions, 7 deletions
diff --git a/activejob/lib/active_job/arguments.rb b/activejob/lib/active_job/arguments.rb index a86a82c6e3..38d5d0214e 100644 --- a/activejob/lib/active_job/arguments.rb +++ b/activejob/lib/active_job/arguments.rb @@ -14,11 +14,14 @@ module ActiveJob end # Raised when an unsupported argument type is set as a job argument. We - # currently support NilClass, Integer, Float, String, TrueClass, FalseClass, - # BigDecimal, and objects that can be represented as GlobalIDs (ex: Active Record). + # currently support String, Integer, Float, NilClass, TrueClass, FalseClass, + # 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 # 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 module Arguments diff --git a/activejob/lib/active_job/enqueuing.rb b/activejob/lib/active_job/enqueuing.rb index 53cb98fc71..b5b9f23c00 100644 --- a/activejob/lib/active_job/enqueuing.rb +++ b/activejob/lib/active_job/enqueuing.rb @@ -9,10 +9,12 @@ module ActiveJob # Includes the +perform_later+ method for job initialization. module ClassMethods - # Push a job onto the queue. The arguments must be legal JSON types - # (+string+, +int+, +float+, +nil+, +true+, +false+, +hash+ or +array+) or - # GlobalID::Identification instances. Arbitrary Ruby objects - # are not supported. + # Push a job onto the queue. By default the arguments must be either String, + # Integer, Float, NilClass, TrueClass, FalseClass, 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. # # Returns an instance of the job class queued with arguments available in # Job#arguments. |