jsonapi.rb
jsonapi.rb copied to clipboard
Rails 7.1 "config.action_dispatch.show_exceptions" support
Rails 7.1 added new config option ":rescuable" for "config.action_dispatch.show_exceptions" (https://mattbrictson.com/blog/rails-71-features#1-finally-we-can-write-proper-integration-tests-for-errors)
Therefore, we can now delete "Rails.env.test?" condition from here: https://github.com/stas/jsonapi.rb/blob/master/lib/jsonapi/errors.rb#L12-L29
I think we'll still need it in order to support older rails versions.
Why don't you conditionally add "Rails.env.test?" by reading config.action_dispatch.show_exceptions or Rails verison?