Merge pull request #1565 from Freika/fix/warden-in-jobs

Fix/warden in jobs
This commit is contained in:
Evgenii Burmakin 2025-07-26 12:49:21 +02:00 committed by GitHub
commit 4e93f60eac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 9 deletions

View file

@ -1 +1 @@
0.30.3 0.30.4

View file

@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
# [0.30.4] - 2025-07-25
## Fixed
- The Warden error in jobs is now fixed. #1556
# [0.30.3] - 2025-07-23 # [0.30.3] - 2025-07-23
## Changed ## Changed

View file

@ -37,11 +37,6 @@ module DistanceConvertible
distance.to_f / conversion_factor distance.to_f / conversion_factor
end end
def distance_for_user(user)
user_unit = user.safe_settings.distance_unit
distance_in_unit(user_unit)
end
module ClassMethods module ClassMethods
def convert_distance(distance_meters, unit) def convert_distance(distance_meters, unit)
return 0.0 unless distance_meters.present? return 0.0 unless distance_meters.present?

View file

@ -2,7 +2,7 @@
<div class="card bg-base-200 shadow-lg"> <div class="card bg-base-200 shadow-lg">
<div class="card-body p-4"> <div class="card-body p-4">
<div class="stat-title text-xs">Distance</div> <div class="stat-title text-xs">Distance</div>
<div class="stat-value text-lg"><%= trip.distance_for_user(current_user).round %> <%= distance_unit %></div> <div class="stat-value text-lg"><%= trip.distance_in_unit(distance_unit).round %> <%= distance_unit %></div>
</div> </div>
</div> </div>
<div class="card bg-base-200 shadow-lg"> <div class="card bg-base-200 shadow-lg">

View file

@ -1,5 +1,5 @@
<% if trip.distance.present? %> <% if trip.distance.present? %>
<span class="text-md"><%= trip.distance_for_user(current_user).round %> <%= distance_unit %></span> <span class="text-md"><%= trip.distance_in_unit(distance_unit).round %> <%= distance_unit %></span>
<% else %> <% else %>
<span class="text-md">Calculating...</span> <span class="text-md">Calculating...</span>
<span class="loading loading-dots loading-sm"></span> <span class="loading loading-dots loading-sm"></span>

View file

@ -5,7 +5,7 @@
<span class="hover:underline"><%= trip.name %></span> <span class="hover:underline"><%= trip.name %></span>
</h2> </h2>
<p class="text-sm text-gray-600 text-center"> <p class="text-sm text-gray-600 text-center">
<%= "#{human_date(trip.started_at)} #{human_date(trip.ended_at)}, #{trip.distance_for_user(current_user).round} #{current_user.safe_settings.distance_unit}" %> <%= "#{human_date(trip.started_at)} #{human_date(trip.ended_at)}, #{trip.distance_in_unit(current_user.safe_settings.distance_unit).round} #{distance_unit}" %>
</p> </p>
<div style="width: 100%; aspect-ratio: 1/1;" <div style="width: 100%; aspect-ratio: 1/1;"