Flights can be corrected after they're saved

- Edit on a flight: owners can correct any flight; a pilot, the flights
  they logged (the same rule as its engine data).
- Date, airports, route, notes, oil and fuel (its oil and fuel records
  follow) and the attached files can always be changed.
- The meter readings only on the latest flight, while its tach in is
  still the aircraft's tach: the aircraft and installed components move
  by the difference, and with both readings the duration is worked out
  from them. On earlier flights they're locked (later flights started
  from them), pointing to Update Hours; the server ignores them too.
- Each correction is in the activity log with what changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-15 17:12:05 -05:00
1 parent 34879e7310
commit d2cd60c6a7
11 files changed
+274 -38

No files matched your search

+12
View File
@@ -821,6 +821,7 @@ en:
flight_logs:
flight_already_logged: Flight already logged.
flight_logged_hrs: Flight logged (%{tach_time} hrs).
flight_corrected: Flight corrected.
choose_an_engine_data: Choose an engine data file.
engine_data_attached: Engine data attached.
engine_data_removed: Engine data removed.
@@ -2331,6 +2332,15 @@ en:
skipped: Skipped
warning: Warning
flight_logs:
edit:
correct_flight: Correct Flight
correct_the_flight_on: Correct the flight on %{date}
changing_the_readings: Changing the readings moves the aircraft's and its components' hours by the difference.
save: Save
cancel: Cancel
fields:
meters_locked_html: The readings can be corrected only on the latest flight, before the hours change again. To correct the hours, use %{link} on the Overview.
update_hours: Update Hours
days:
gps_track_attached: GPS track attached
engine_data_attached: Engine data attached
@@ -2437,6 +2447,7 @@ en:
flight_on_html: Flight on %{date}
delete_this_flight_log_aircraft: Delete this flight log? Aircraft and component hours will NOT be rolled back.
delete: Delete
edit: Edit
tach: Tach
hobbs: Hobbs
route: Route
@@ -3640,6 +3651,7 @@ en:
hours_notes: 'Previous: %{old}, delta: %{delta}'
consumable_added: "%{type} added: %{quantity} %{unit}"
flight_logged: 'Flight logged: %{hours} hrs'
flight_corrected: 'Flight corrected: %{date}'
flight_logged_route: 'Flight logged: %{hours} hrs (%{route})'
aircraft_grounded_error:
message: Aircraft is grounded and airworthiness enforcement is enabled
+1 -1
View File
@@ -57,7 +57,7 @@ Rails.application.routes.draw do
resources :notes, except: :show do
post :preview, on: :collection
end
resources :flight_logs, only: %i[index new create show destroy] do
resources :flight_logs, only: %i[index new create show edit update destroy] do
member do
get :engine_data, action: :engine_data_series
patch :engine_data, action: :attach_engine_data