collectiveidea / delayed_job

Database based asynchronous priority queue system -- Extracted from Shopify
http://groups.google.com/group/delayed_job
MIT License
4.81k stars 955 forks source link

Date#to_s deprecation warning for queuing method calls on objects containing dates #1205

Open jkotchoff opened 4 months ago

jkotchoff commented 4 months ago

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.