mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
- Admin → Recordkeeping Procedures: generated procedures document (2.2.11 / 3.2.8) from the system setup plus owner-entered details; adopted as numbered, immutable revisions; included in the records package - Admin → Records Audits: periodic QC checklist (3.2.8.5) combining app checks with a restore test, sampled entries vs. source documents and a user review; next due date on About and in admins' weekly reminder - User instructions at /help/records, linked from the logbook and signing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
651 B
Ruby
19 lines
651 B
Ruby
# A quality-control audit of the electronic records (AC 120-78B 3.2.8.5):
|
|
# a checklist, some items checked by the app, some confirmed by the auditor.
|
|
class AuditRun < ApplicationRecord
|
|
belongs_to :performed_by, class_name: "User", optional: true
|
|
|
|
scope :latest_first, -> { order(performed_at: :desc) }
|
|
before_update { throw :abort }
|
|
before_destroy { throw :abort }
|
|
|
|
def self.latest = latest_first.first
|
|
|
|
def self.next_due
|
|
interval = RecordkeepingPolicy.current.audit_interval_months.months
|
|
(latest&.performed_at || Time.current - interval).to_date + interval
|
|
end
|
|
|
|
def self.due_soon? = next_due <= 14.days.from_now.to_date
|
|
end
|