From 3e8e49139a711040915ab89f824a0669a508cf44 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sun, 18 May 2025 22:24:37 +0200 Subject: [PATCH] Fixed a bug where default distance unit was not being set for users. #1206 --- .app_version | 2 +- CHANGELOG.md | 6 ++++++ .../20250518174305_set_default_distance_unit_for_user.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.app_version b/.app_version index 894542aa..3f45a644 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.26.2 +0.26.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5627ae2e..3acff7c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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.26.3 - 2025-05-18 + +## Fixed + +- Fixed a bug where default distance unit was not being set for users. #1206 + # 0.26.2 - 2025-05-18 diff --git a/db/data/20250518174305_set_default_distance_unit_for_user.rb b/db/data/20250518174305_set_default_distance_unit_for_user.rb index a7dadb6d..43e798ac 100644 --- a/db/data/20250518174305_set_default_distance_unit_for_user.rb +++ b/db/data/20250518174305_set_default_distance_unit_for_user.rb @@ -5,7 +5,7 @@ class SetDefaultDistanceUnitForUser < ActiveRecord::Migration[8.0] User.find_each do |user| map_settings = user.settings['maps'] - next if map_settings['distance_unit'].in?(%w[km mi]) + next if map_settings.try(:[], 'distance_unit')&.in?(%w[km mi]) if map_settings.blank? map_settings = { distance_unit: 'km' }