Sitelet https://github.com/jsonapi-serializer/jsonapi-serializer/issues/247
Skip to content

jsonapi-serializer affects the config.active_support.disable_to_s_conversion option. #247

Description

@dev-jwshin

Description

after upgrading the rails from 6.1 to 7, we are activating the options listed in the 'new_framework_defaults_7_0.rb' file one by one, as required in the official document.

according to the official document, enabling the option 'disable_to_s_conversion' should result in an error in a command such as 'Time.now.to _s(:db)'.

however, if the jsonapi-serializer gem is installed, a WARNING occurs instead of an error and the command is executed.

Expected Behavior

irb(main):001:0> Time.now.to_s(:db)
(irb):1:in `to_s': wrong number of arguments (given 1, expected 0) (ArgumentError)

Actual Behavior

irb(main):001:0> Time.now.to_s(:db)
DEPRECATION WARNING: Time#to_s(:db) is deprecated. Please use Time#to_fs(:db) instead. (called from <main> at (irb):1)
=> "2024-04-30 13:40:17"

Steps to Reproduce the Problem

  1. upgrade the rails from 6.1 to 7.
  2. enable the config.active_support.disable_to_s_conversion option.
  3. run rails console
  4. run Time.now.to_s(:db)

Specifications

  • Version: 2.2
  • Ruby version: ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions