aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2016-01-01 18:58:42 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2016-01-01 18:58:42 -0300
commit4d98b0d837b29d34355f3fcb3916b6ac4a8b1bef (patch)
tree49602d8084187765c1bd3dfca515c6f336f44c28 /activejob
parent4b9e83af2eead9670b8f1aa6718af01429345ef8 (diff)
parent135258af0b9c8e76e94c0e121d5de588bae35f29 (diff)
downloadrails-4d98b0d837b29d34355f3fcb3916b6ac4a8b1bef.tar.gz
rails-4d98b0d837b29d34355f3fcb3916b6ac4a8b1bef.tar.bz2
rails-4d98b0d837b29d34355f3fcb3916b6ac4a8b1bef.zip
Merge pull request #22487 from joshsoftware/issue_22413
Added support for bigdecimals in perform_later
Diffstat (limited to 'activejob')
-rw-r--r--activejob/lib/active_job/arguments.rb4
-rw-r--r--activejob/test/cases/argument_serialization_test.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/activejob/lib/active_job/arguments.rb b/activejob/lib/active_job/arguments.rb
index e56bc79328..33bd5b4eb3 100644
--- a/activejob/lib/active_job/arguments.rb
+++ b/activejob/lib/active_job/arguments.rb
@@ -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.
diff --git a/activejob/test/cases/argument_serialization_test.rb b/activejob/test/cases/argument_serialization_test.rb
index 933972a52b..eb8ad185aa 100644
--- a/activejob/test/cases/argument_serialization_test.rb
+++ b/activejob/test/cases/argument_serialization_test.rb
@@ -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|