AD baseline: record DRS imports and the models they covered; weekly search starts from the last import; reminders and audit check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-11 20:56:20 -05:00
1 parent ba0455b149
commit 8bea2abf75
13 files changed
+169 -4

No files matched your search

+3
View File
@@ -29,6 +29,9 @@ class AdImportsController < ApplicationController
# Only AD numbers present in the uploaded file; values are checked against AdImport::ACTIONS.
decisions = params.fetch(:decisions, {}).permit(*import.rows.map(&:number)).to_h
result = import.import!(decisions: decisions, user: current_user)
@aircraft.drs_imports.create!(user: current_user, filename: params[:filename].to_s.first(200), ad_count: import.rows.size,
tracked: result[:tracked], not_applicable: result[:not_applicable],
models_covered: DrsImport.covered(@aircraft, import.rows.flat_map(&:models)))
discard_upload(token)
redirect_to aircraft_airworthiness_directives_path(@aircraft),
notice: "Imported #{result[:tracked]} ADs to track and #{result[:not_applicable]} marked N/A; " \