1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #35516 from soartec-lab/update_multiline_sample_code

Update `multiline?` sample code [ci skip]
This commit is contained in:
Ryuta Kamizono 2019-03-08 01:12:41 +09:00 committed by GitHub
commit a62683f3e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2789,10 +2789,10 @@ Regexp.new('.', Regexp::MULTILINE).multiline? # => true
Rails uses this method in a single place, also in the routing code. Multiline regexps are disallowed for route requirements and this flag eases enforcing that constraint.
```ruby
def assign_route_options(segments, defaults, requirements)
def verify_regexp_requirements(requirements)
...
if requirement.multiline?
raise ArgumentError, "Regexp multiline option not allowed in routing requirements: #{requirement.inspect}"
raise ArgumentError, "Regexp multiline option is not allowed in routing requirements: #{requirement.inspect}"
end
...
end