Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jkotchoff opened this issue Feb 26, 2024 · 0 comments

Comments

@jkotchoff
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant