mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Fix a few bugs
This commit is contained in:
parent
38a32f245f
commit
cf3b7a116d
6 changed files with 52 additions and 6 deletions
|
|
@ -1 +1 @@
|
|||
0.26.1
|
||||
0.26.2
|
||||
|
|
|
|||
11
CHANGELOG.md
11
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
|
||||
|
||||
|
|
|
|||
11
db/data/20250518173936_fix_france_codes.rb
Normal file
11
db/data/20250518173936_fix_france_codes.rb
Normal file
|
|
@ -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
|
||||
24
db/data/20250518174305_set_default_distance_unit_for_user.rb
Normal file
24
db/data/20250518174305_set_default_distance_unit_for_user.rb
Normal file
|
|
@ -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
|
||||
|
|
@ -1 +1 @@
|
|||
DataMigrate::Data.define(version: 20250516181033)
|
||||
DataMigrate::Data.define(version: 20250518174305)
|
||||
|
|
|
|||
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Reference in a new issue