[openstreetmap/openstreetmap-website] Make traces feature optional via traces_disabled setting (PR #7156)

Lee Kindness notifications at github.com
Sun Jun 28 21:00:10 UTC 2026


@wangi commented on this pull request.



> @@ -107,13 +104,17 @@
     end
     post "/user/messages/:id" => "messages#update", :as => nil
 
-    resources :traces, :path => "gpx", :only => [:create, :show, :update, :destroy], :id => /\d+/ do
-      scope :module => :traces do
-        resource :data, :only => :show
+    constraints(->(_req) { !Settings.traces_disabled }) do

I've moved the trace disabled tests to after the others. 

Yes,  it's there for the tests code. With a simple static if, it would only be testing the local configuration of  `traces_disabled` . I've added comments so this is clearer.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7156#discussion_r3488528624
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7156/review/4588093231 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260628/cbcd7282/attachment.htm>


More information about the rails-dev mailing list