delayed_job
delayed_job copied to clipboard
Date#to_s deprecation warning for queuing method calls on objects containing dates
When queuing jobs with the delay.method(params)
syntax, if the object contains dates or datetimes, this will raise a warning about the deprecated nature of calling #to_s on a date object.
Eg.
class ContainsDate
def initialize
@date = Date.today
end
end
irb(main):017> ContainsDate.new.delay.inspect
DEPRECATION WARNING: Using a :default format for Date#to_s is deprecated. Please use Date#to_fs instead. If you fixed all places inside your application that you see this deprecation, you can set `ENV['RAILS_DISABLE_DEPRECATED_TO_S_CONVERSION']` to `"true"` in the `config/application.rb` file before the `Bundler.require` call to fix all the callers outside of your application. (called from <main> at bin/rails:4)
When this to_s
method is removed for date objects, it will break the delay.method(params)
functionality of delayed_job.