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
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/)
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
## Changed

View File

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

View File

@@ -2,7 +2,7 @@
<div class="card bg-base-200 shadow-lg">
<div class="card-body p-4">
<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 class="card bg-base-200 shadow-lg">

View File

@@ -1,5 +1,5 @@
<% 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 %>
<span class="text-md">Calculating...</span>
<span class="loading loading-dots loading-sm"></span>

View File

@@ -5,7 +5,7 @@
<span class="hover:underline"><%= trip.name %></span>
</h2>
<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>
<div style="width: 100%; aspect-ratio: 1/1;"