From dd2b3f37b77600ee50023dc3e840061844eca7ec Mon Sep 17 00:00:00 2001 From: Shimon Hori Date: Tue, 21 Apr 2020 14:37:45 +0900 Subject: [PATCH] Fix errors on Redmine 4.x - An error occurred while loading the routes definition of redmine_json_rpc plugin (/usr/src/redmine/plugins/redmine_json_rpc/config/routes.rb): uninitialized constant ActionController::Routing. - undefined method `before_filter' for JsonRpcCallController:Class (NoMethodError) --- app/controllers/json_rpc_call_controller.rb | 4 ++-- config/routes.rb | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/json_rpc_call_controller.rb b/app/controllers/json_rpc_call_controller.rb index 01cb17e..15c94f2 100644 --- a/app/controllers/json_rpc_call_controller.rb +++ b/app/controllers/json_rpc_call_controller.rb @@ -1,8 +1,8 @@ class JsonRpcCallController < ApplicationController unloadable - before_filter :require_admin - before_filter :authorize_global + before_action :require_admin + before_action :authorize_global accept_api_auth :handle_rpc_request def handle_rpc_request diff --git a/config/routes.rb b/config/routes.rb index c999c79..dc68246 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1 @@ -ActionController::Routing::Routes.draw do |map| - map.connect 'json_rpc_call.:format', :controller => 'json_rpc_call', :action => 'handle_rpc_request' -end +match 'json_rpc_call.:format', :controller => 'json_rpc_call', :action => 'handle_rpc_request', :via => [:get, :post, :delete, :put, :patch]