From c7de42ab967ddd18cd5d21b81095c1f6833e36d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 6 Mar 2023 17:44:33 +0100 Subject: [PATCH] Simplify map location coordinates helpers We're calling this method after setting the map location with `map_location = MapLocation.new if map_location.nil?`, so the condition `map_location.present?` is always going to be true. --- app/helpers/map_locations_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/map_locations_helper.rb b/app/helpers/map_locations_helper.rb index 0cbee2b69..8bc28ce7d 100644 --- a/app/helpers/map_locations_helper.rb +++ b/app/helpers/map_locations_helper.rb @@ -4,15 +4,15 @@ module MapLocationsHelper end def map_location_latitude(map_location) - map_location.present? && map_location.latitude.present? ? map_location.latitude : Setting["map.latitude"] + map_location.latitude.presence || Setting["map.latitude"] end def map_location_longitude(map_location) - map_location.present? && map_location.longitude.present? ? map_location.longitude : Setting["map.longitude"] + map_location.longitude.presence || Setting["map.longitude"] end def map_location_zoom(map_location) - map_location.present? && map_location.zoom.present? ? map_location.zoom : Setting["map.zoom"] + map_location.zoom.presence || Setting["map.zoom"] end def map_location_input_id(prefix, attribute)