summaryrefslogtreecommitdiff
path: root/config/initializers/action_dispatch_journey_formatter.rb
blob: 108fb2e50128c1ef058771226ab753cf317f8100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

# TODO: Eliminate this file when https://github.com/rails/rails/pull/38184 is released.
# Cleanup issue: https://gitlab.com/gitlab-org/gitlab/issues/195841
ActionDispatch::Journey::Formatter.prepend(Gitlab::Patch::ActionDispatchJourneyFormatter)

module ActionDispatch
  module Journey
    module Path
      class Pattern
        def requirements_for_missing_keys_check
          @requirements_for_missing_keys_check ||= requirements.transform_values do |regex|
            /\A#{regex}\Z/
          end
        end
      end
    end
  end
end