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:
commit
a62683f3e4
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue