Skip to content

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

@amilligan

Description

@amilligan

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions