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

ActiveSupport 7.0.7 deprecates setting default date/time format strings for #to_s #69

Open
amilligan opened this issue Aug 27, 2023 · 1 comment

Comments

@amilligan
Copy link
Collaborator

ActiveSupport 7.0 deprecated calling #to_s with a format param. Until now this hasn't been an issue, since FixtureBuilder overrides the default format (to the db format) for dates during the YAML dump. However, as of version 7.0.7 ActiveSupport now also deprecates calling #to_s without a format parameter if the default format string has been set.

The call to #to_s is in the Pysch processor, so we can't change that to use #to_formatted_s, as ActiveSupport wants. Short of some truly heinous monkey patching, I don't see a way to set the format string and make ActiveSupport happy. However, as far as I can tell the db date format is ISO8601, as is the unaltered default date format.

The easy fix for this seems to be simply remove the bit of code that explicitly sets the Date output format. I've tried this out and it seems to work without issue, and all FixtureBuilder tests pass. But, I have to imagine that code was there for a reason. So, thoughts? Comments? Will using the unaltered default date format cause any problems I haven't thought of?

@jayqui
Copy link

jayqui commented May 11, 2024

Seeing this deprecation warning a lot as well after upgrading to Rails 7.0.8.

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

2 participants