From 61fb58f6a7f852d765d616d1da41d17851ec7afc Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 16 May 2021 08:44:59 +0100 Subject: [PATCH] Add Range to list of supported arguments for jobs --- activejob/lib/active_job/arguments.rb | 4 ++-- activejob/lib/active_job/enqueuing.rb | 2 +- guides/source/active_job_basics.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/activejob/lib/active_job/arguments.rb b/activejob/lib/active_job/arguments.rb index b87415ac1b..8aaf4a5293 100644 --- a/activejob/lib/active_job/arguments.rb +++ b/activejob/lib/active_job/arguments.rb @@ -17,8 +17,8 @@ module ActiveJob # 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. + # Array, Range 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 GlobalID - such as an unpersisted Active Record model. diff --git a/activejob/lib/active_job/enqueuing.rb b/activejob/lib/active_job/enqueuing.rb index e3290d31ec..bbf301aeb8 100644 --- a/activejob/lib/active_job/enqueuing.rb +++ b/activejob/lib/active_job/enqueuing.rb @@ -17,7 +17,7 @@ module ActiveJob # 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 + # Hash, ActiveSupport::HashWithIndifferentAccess, Array, Range or # GlobalID::Identification instances, although this can be extended by adding # custom serializers. # diff --git a/guides/source/active_job_basics.md b/guides/source/active_job_basics.md index 083f8cb778..5f683cd8f4 100644 --- a/guides/source/active_job_basics.md +++ b/guides/source/active_job_basics.md @@ -387,6 +387,7 @@ ActiveJob supports the following types of arguments by default: - `Hash` (Keys should be of `String` or `Symbol` type) - `ActiveSupport::HashWithIndifferentAccess` - `Array` + - `Range` - `Module` - `Class`