Fixed a bug where default distance unit was not being set for users. #1206

This commit is contained in:
Eugene Burmakin 2025-05-18 22:24:37 +02:00
parent cf3b7a116d
commit 3e8e49139a
3 changed files with 8 additions and 2 deletions

View file

@ -1 +1 @@
0.26.2
0.26.3

View file

@ -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

View file

@ -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' }