From 7bf6c7d3a3b3c5880780279632d8c3628752ef94 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 16 Jun 2023 13:38:56 +0100 Subject: [PATCH] DEV: Fix Zeitwerk reloading error (#249) Using `.append` can lead to a 'two routes with the same name' error Reproduced via ``` rails runner 'Rails.application.reloader.reload!' ``` --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 1a628f2..c34b206 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,7 +15,7 @@ DiscourseDataExplorer::Engine.routes.draw do end end -Discourse::Application.routes.append do +Discourse::Application.routes.draw do get "/g/:group_name/reports" => "discourse_data_explorer/query#group_reports_index" get "/g/:group_name/reports/:id" => "discourse_data_explorer/query#group_reports_show" post "/g/:group_name/reports/:id/run" => "discourse_data_explorer/query#group_reports_run"