Skip to content

Bump to ruby 3 (encore une fois)

Vincent Agnano requested to merge ruby302 into production

Created by: n-b

Résumé des épisodes précédents:

  • #1648
  • #1688

For some reason in Ruby 3, encoding ActiveRecord objects in JSON takes a different path. I tracked it down to ActiveSupport::ToJsonWithActiveSupportEncoder: In ruby 3, options.is_a?(::JSON::State), in ruby 2.7 it uses ActiveSupport::JSON regularly.

The best source I can find is this SO discussion: https://stackoverflow.com/questions/66871265/to-json-on-activerecord-object-ruby-3-0

The workaround is to manually convert to json.

Merge request reports