diff --git a/app/controllers/map/leaflet_controller.rb b/app/controllers/map/leaflet_controller.rb index 07431bfb..0c425a57 100644 --- a/app/controllers/map/leaflet_controller.rb +++ b/app/controllers/map/leaflet_controller.rb @@ -41,7 +41,7 @@ class Map::LeafletController < ApplicationController end def calculate_distance - return 0 if @points.count < 2 + return 0 if @points.count(:id) < 2 # Use PostGIS window function for efficient distance calculation # This is O(1) database operation vs O(n) Ruby iteration diff --git a/spec/requests/api/v1/users_spec.rb b/spec/requests/api/v1/users_spec.rb index b1669b39..3af357f3 100644 --- a/spec/requests/api/v1/users_spec.rb +++ b/spec/requests/api/v1/users_spec.rb @@ -27,7 +27,7 @@ RSpec.describe 'Api::V1::Users', type: :request do speed_colored_routes points_rendering_mode minutes_between_routes time_threshold_minutes merge_threshold_minutes live_map_enabled route_opacity immich_url photoprism_url visits_suggestions_enabled - speed_color_scale fog_of_war_threshold + speed_color_scale fog_of_war_threshold globe_projection ]) end end