[openstreetmap/openstreetmap-website] Editor color mode preference (PR #6492)

Marwin Hochfelsner notifications at github.com
Wed Nov 5 02:02:59 UTC 2025


@hlfan commented on this pull request.



> @@ -275,11 +275,12 @@ def preferred_editor
   end
 
   def preferred_color_scheme(subject)
-    if current_user
-      current_user.preferences.find_by(:k => "#{subject}.color_scheme")&.v || "auto"
-    else
-      "auto"
-    end
+    scheme = current_user ? current_user.preferences.find_by(:k => "#{subject}.color_scheme")&.v : nil

Only with offending RuboCop. But not going into the subjects loop seems even better.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6492/review/3419332502 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251104/40639467/attachment.htm>


More information about the rails-dev mailing list