mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22487 from joshsoftware/issue_22413
Added support for bigdecimals in perform_later
This commit is contained in:
commit
4d98b0d837
2 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ module ActiveJob
|
|||
|
||||
# Raised when an unsupported argument type is set as a job argument. We
|
||||
# currently support NilClass, Fixnum, Float, String, TrueClass, FalseClass,
|
||||
# Bignum and objects that can be represented as GlobalIDs (ex: Active Record).
|
||||
# Bignum, BigDecimal, and objects that can be represented as GlobalIDs (ex: Active Record).
|
||||
# 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.
|
||||
|
@ -34,7 +34,7 @@ module ActiveJob
|
|||
module Arguments
|
||||
extend self
|
||||
# :nodoc:
|
||||
TYPE_WHITELIST = [ NilClass, Fixnum, Float, String, TrueClass, FalseClass, Bignum ]
|
||||
TYPE_WHITELIST = [ NilClass, Fixnum, Float, String, TrueClass, FalseClass, Bignum, BigDecimal ]
|
||||
|
||||
# Serializes a set of arguments. Whitelisted types are returned
|
||||
# as-is. Arrays/Hashes are serialized element by element.
|
||||
|
|
|
@ -10,7 +10,7 @@ class ArgumentSerializationTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
[ nil, 1, 1.0, 1_000_000_000_000_000_000_000,
|
||||
'a', true, false,
|
||||
'a', true, false, BigDecimal.new(5),
|
||||
[ 1, 'a' ],
|
||||
{ 'a' => 1 }
|
||||
].each do |arg|
|
||||
|
|
Loading…
Reference in a new issue