Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background:
As part of our Rails 6 upgrade process, I've encountered an issue related to the
format: false
constraint. In Rails 6, there have been changes in the way constraints are handled, specifically involving the use ofRegexp.union(re)
.Issue:
The particular error we're facing is a
TypeError: No implicit conversion of false into String
. This is occurring due to the introduction ofRegexp.union(re)
in Rails 6, which expects string values and does not accept boolean values.Proposed Solution:
To address this issue, we're proposing the removal of the format: false constraint. In our investigation, we found that the Rails 6 update now relies on
Regexp.union(re)
, which only accepts string values in constraints.Testing:
We have already added test cases to validate the behavior after removing the format: false constraint. These tests are aimed at ensuring the smooth functioning of our application under the Rails 6 environment.
Links
Rails 6.0 -
https://github.com/rails/rails/blob/6-0-stable/actionpack/lib/action_dispatch/journey/path/pattern.rb#L93
Rails 5.2 -
https://github.com/rails/rails/blob/5-2-stable/actionpack/lib/action_dispatch/journey/path/pattern.rb#L93