From 8997d10658078267a4d90260bea204119300f07c Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 11 Feb 2025 21:38:41 +0100 Subject: [PATCH] Fix speed units on the Points page --- .app_version | 2 +- CHANGELOG.md | 6 +++++- app/helpers/application_helper.rb | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.app_version b/.app_version index 2094a100..48b91fd8 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.24.0 +0.24.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 76df144a..233e7708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -# 0.24.1 - 2025-02-10 +# 0.24.1 - 2025-02-11 ## Custom map tiles @@ -24,6 +24,10 @@ To set a custom tile URL, go to the user settings and set the `Maps` section to ruby_dawarich_map_tiles_usage 99 ``` +### Fixed + +- Speed on the Points page is now being displayed in kilometers per hour. + # 0.24.0 - 2025-02-10 ## Points speed units diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c6258d08..a4a01a5e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -120,4 +120,10 @@ module ApplicationHelper 'text-red-500' end + + def point_speed(speed) + return speed if speed.to_i <= 0 + + speed * 3.6 + end end