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

Fix a rails 6.1 deprecation warning for the duration attribute #1408

Merged

Conversation

Earlopain
Copy link
Collaborator

This is only a thing on Rails 6.1, I noticed this in the CI output for the system tests. It doesn't seem to terribly matter right now if it is returned as a string or interval but I don't think this distinction was intended.

DEPRECATION WARNING: The behavior of the `:interval` type will be changing in Rails 7.0
to return an `ActiveSupport::Duration` object. If you'd like to keep
the old behavior, you can add this line to GoodJob::Execution model:

  attribute :duration, :string

If you'd like the new behavior today, you can add this line:

  attribute :duration, :interval
 (called from block (3 levels) in perform at /home/runner/work/good_job/good_job/app/models/good_job/base_execution.rb:440)

```
DEPRECATION WARNING: The behavior of the `:interval` type will be changing in Rails 7.0
to return an `ActiveSupport::Duration` object. If you'd like to keep
the old behavior, you can add this line to GoodJob::Execution model:

  attribute :duration, :string

If you'd like the new behavior today, you can add this line:

  attribute :duration, :interval
 (called from block (3 levels) in perform at /home/runner/work/good_job/good_job/app/models/good_job/base_execution.rb:440)
```
@Earlopain Earlopain force-pushed the duration-rails-6.1-deprecation branch from 0e7f7e8 to e314e9c Compare July 8, 2024 17:01
@Earlopain
Copy link
Collaborator Author

I tried making specs fail to verify but I believe this is throwing a wrench into that:

duration: 60.seconds,

The deprecation is gone from the system tests though: https://github.com/bensheldon/good_job/actions/runs/9843564859/job/27175035831 vs https://github.com/bensheldon/good_job/actions/runs/9843820235/job/27175887019 so I believe this is fine

@Earlopain Earlopain marked this pull request as ready for review July 8, 2024 17:08
@bensheldon bensheldon added the bug Something isn't working label Jul 8, 2024
@bensheldon
Copy link
Owner

Thank you 🎉

@bensheldon bensheldon merged commit 38f5758 into bensheldon:main Jul 8, 2024
14 checks passed
@Earlopain Earlopain deleted the duration-rails-6.1-deprecation branch July 8, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

2 participants