crosscite / content-negotiation

DOI content negotiation
https://data.crosscite.org
MIT License
3 stars 4 forks source link

Upgrade to 6.0 and 6.1 #135

Closed ashwinisukale closed 10 months ago

ashwinisukale commented 10 months ago

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 of Regexp.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 of Regexp.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