From 23a28cd1a94600913b1e1bd87729fe7810e95d7e Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Thu, 3 Dec 2020 16:06:15 +0800 Subject: [PATCH] FIX delete route regx --- config/application.rb | 2 -- config/routes.rb | 12 ++---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/config/application.rb b/config/application.rb index f9a4333f1..a09b08def 100644 --- a/config/application.rb +++ b/config/application.rb @@ -20,8 +20,6 @@ module Educoderplus # config.educoder = config_for(:configuration) # Custom directories with classes and modules you want to be autoloadable. - # config.eager_load_paths << Rails.root.join('lib') - config.eager_load_paths += %W(#{config.root}/lib) config.active_record.default_timezone = :utc config.time_zone = 'Beijing' diff --git a/config/routes.rb b/config/routes.rb index 58b2ddebe..2010e614a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -325,20 +325,13 @@ Rails.application.routes.draw do # protected_branches scope do - # get ':protected_branches/:action/:id/:user_id', constraints: { branch_name: Forgeplus::Regex.git_reference_regex } - # post '/protected_branches' => 'protected_branches#create' - # delete '/protected_branches/:branch_name' => 'protected_branches#destroy', - # constraints: { branch_name: Forgeplus::Regex.git_reference_regex } - # patch '/protected_branches/:branch_name' => 'protected_branches#update', - # constraints: { branch_name: Forgeplus::Regex.git_reference_regex } get( '/protected_branches/', to: 'protected_branches#index' ) delete( '/protected_branches/:branch_name', - to: 'protected_branches#destroy', - constraints: { branch_name: Forgeplus::Regex.git_reference_regex } + to: 'protected_branches#destroy' ) post( '/protected_branches', @@ -346,8 +339,7 @@ Rails.application.routes.draw do ) patch( '/protected_branches/:branch_name', - to: 'protected_branches#update', - constraints: { branch_name: Forgeplus::Regex.git_reference_regex } + to: 'protected_branches#update' ) end