diff --git a/.app_version b/.app_version index 30f6cf8d..894542aa 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.26.1 +0.26.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1babf7..5627ae2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -# 0.26.1 - 2025-05-15 +# 0.26.2 - 2025-05-18 + +## Fixed + +- Seeds are now working properly. #1207 +- Fixed a bug where France flag was not being displayed correctly. #1204 +- Fix blank map page caused by empty default distance unit. Default distance unit is now kilometers and can be changed in Settings -> Maps. #1206 + + +# 0.26.1 - 2025-05-18 ## Geodata on demand diff --git a/db/data/20250518173936_fix_france_codes.rb b/db/data/20250518173936_fix_france_codes.rb new file mode 100644 index 00000000..07ebbe25 --- /dev/null +++ b/db/data/20250518173936_fix_france_codes.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class FixFranceCodes < ActiveRecord::Migration[8.0] + def up + Country.find_by(name: 'France')&.update(iso_a2: 'FR', iso_a3: 'FRA') + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/data/20250518174305_set_default_distance_unit_for_user.rb b/db/data/20250518174305_set_default_distance_unit_for_user.rb new file mode 100644 index 00000000..a7dadb6d --- /dev/null +++ b/db/data/20250518174305_set_default_distance_unit_for_user.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class SetDefaultDistanceUnitForUser < ActiveRecord::Migration[8.0] + def up + User.find_each do |user| + map_settings = user.settings['maps'] + + next if map_settings['distance_unit'].in?(%w[km mi]) + + if map_settings.blank? + map_settings = { distance_unit: 'km' } + else + map_settings['distance_unit'] = 'km' + end + + user.settings['maps'] = map_settings + user.save! + end + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/data_schema.rb b/db/data_schema.rb index ce0074c2..d245dde6 100644 --- a/db/data_schema.rb +++ b/db/data_schema.rb @@ -1 +1 @@ -DataMigrate::Data.define(version: 20250516181033) +DataMigrate::Data.define(version: 20250518174305) diff --git a/db/seeds.rb b/db/seeds.rb index a305f1be..8e96a514 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -3,16 +3,18 @@ if User.none? puts 'Creating user...' + email = 'demo@dawarich.app' + User.create!( - email: 'demo@dawarich.app', + email:, password: 'password', password_confirmation: 'password', admin: true, - active: true, + status: :active, active_until: 100.years.from_now ) - puts "User created: #{User.first.email} / password: 'password'" + puts "User created: '#{email}' / password: 'password'" end if Country.none?