Skip to content
  • Hartley McGuire's avatar
    7e9ffc2e
    Fix to_s not using :default format with no args · 7e9ffc2e
    Hartley McGuire authored
    When `to_s` was [deprecated][1] for `to_fs`, warnings were added when
    explicit formats were passed to `to_s`. To determine whether a format
    argument was passed, the method signature was changed from
    `to_s(format = :default)` to `to_s(format = EMPTY_OBJECT)`. While this
    enabled being able to warn on formats passed, it changed the behavior of
    not passing any format for applications that customized the `:default`
    format for one of these classes.
    
    This commit restores the previous behavior for `:default` formats while
    keeping the existing warnings. Additionally, it will continue to not
    warn for applications using `to_s` without arguments that haven't set a
    custom `:default` format. However, for applications that have set a
    custom `:default` format, it will now warn that those classes should be
    migrated to `to_fs`.
    
    [1]: f9fbfe0a
    7e9ffc2e
    Fix to_s not using :default format with no args
    Hartley McGuire authored
    When `to_s` was [deprecated][1] for `to_fs`, warnings were added when
    explicit formats were passed to `to_s`. To determine whether a format
    argument was passed, the method signature was changed from
    `to_s(format = :default)` to `to_s(format = EMPTY_OBJECT)`. While this
    enabled being able to warn on formats passed, it changed the behavior of
    not passing any format for applications that customized the `:default`
    format for one of these classes.
    
    This commit restores the previous behavior for `:default` formats while
    keeping the existing warnings. Additionally, it will continue to not
    warn for applications using `to_s` without arguments that haven't set a
    custom `:default` format. However, for applications that have set a
    custom `:default` format, it will now warn that those classes should be
    migrated to `to_fs`.
    
    [1]: f9fbfe0a
Loading