Skip to content

Commit

Permalink
Use the 6-0-stable version of Rails to fix issue with JSON responses
Browse files Browse the repository at this point in the history
The test suite was failing on Rails 6.0 + Ruby 3 with errors like:

    Expected "{\"errors\":\"#<ActiveModel::Errors:0x000055f2e6cb8188>\"}"
    to include "{\"errors\":{".

The ActiveModel::Errors object wasn't being serialized to JSON as
expected, and this only happened with that combination of Ruby/Rails.

Upon further investigation, this was caused by a change in Ruby and
fixed in Rails in this PR: rails/rails#39697
(which describes in more details the exact same problem and links to the
Ruby bug tracker with more information).

That fix was backported to 6-0-stable in June 2020, but hasn't been
officially released in a stable version yet: (there have been only
security fixes since then for 6.0)
rails/rails@75f6539

Since the branch contains the fix, I'm pointing directly to it to get
the tests passing. We can't tell if there'll be a new stable 6.0 release
at this point, but hopefully yes, in which case we can go back at
pointing to it.
  • Loading branch information
carlosantoniodasilva committed Feb 15, 2021
1 parent c82a381 commit faef12c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gemfiles/Gemfile-rails-6-0
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source "https://rubygems.org"

gemspec path: ".."

gem "rails", '~> 6.0.0'
gem "rails", '~> 6.0.0', github: 'rails/rails', branch: '6-0-stable'
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"
Expand Down

0 comments on commit faef12c

Please sign in to comment.