From 9e30d50925298d1650a879a7697e5945d46d8bf1 Mon Sep 17 00:00:00 2001 From: Oleh Fedorenko Date: Fri, 20 Sep 2024 14:15:59 +0000 Subject: [PATCH] Fixes #37848 - Support Rails 7.0 --- config/routes.rb | 44 ++++++++++++++++++-------------------- test/test_plugin_helper.rb | 1 - 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 1a0431e4f..dd50f80ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,30 +7,28 @@ :defaults => { apiv: 'v2' }, :apiv => /v2/, :constraints => ApiConstraints.new(version: 2, default: true) do - constraints(:id => %r{[^\/]+}) do - resources :hosts, :only => [] do - member do - post :play_roles - get :ansible_roles - post :assign_ansible_roles - put 'ansible_roles/:ansible_role_id', :to => 'hosts#add_ansible_role', :constraints => { id: %r{[^\/]+} } - delete 'ansible_roles/:ansible_role_id', :to => 'hosts#remove_ansible_role', :constraints => { id: %r{[^\/]+} } - end - collection do - post :multiple_play_roles - end + resources :hosts, :only => [] do + member do + post :play_roles + get :ansible_roles + post :assign_ansible_roles + put 'ansible_roles/:ansible_role_id', :to => 'hosts#add_ansible_role' + delete 'ansible_roles/:ansible_role_id', :to => 'hosts#remove_ansible_role' end - resources :hostgroups, :only => [] do - member do - post :play_roles - get :ansible_roles - post :assign_ansible_roles - put 'ansible_roles/:ansible_role_id', :to => 'hostgroups#add_ansible_role', :constraints => { id: %r{[^\/]+} } - delete 'ansible_roles/:ansible_role_id', :to => 'hostgroups#remove_ansible_role', :constraints => { id: %r{[^\/]+} } - end - collection do - post :multiple_play_roles - end + collection do + post :multiple_play_roles + end + end + resources :hostgroups, :only => [] do + member do + post :play_roles + get :ansible_roles + post :assign_ansible_roles + put 'ansible_roles/:ansible_role_id', :to => 'hostgroups#add_ansible_role' + delete 'ansible_roles/:ansible_role_id', :to => 'hostgroups#remove_ansible_role' + end + collection do + post :multiple_play_roles end end end diff --git a/test/test_plugin_helper.rb b/test/test_plugin_helper.rb index 968cd77e9..ff5ca6341 100644 --- a/test/test_plugin_helper.rb +++ b/test/test_plugin_helper.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'test_helper' -require 'facets' def ansible_fixture_file(filename) File.join(