Editable logbook templates; component times follow the airframe time

- Templates move to the database (Admin -> Logbook templates: add, edit,
  delete, restore the built-in ones). The built-in preventive maintenance
  set is added once on first use; deletions stick. A template can set the
  entry type, logbook (picking the matching component) and certificate
- Template list shows "Name — Part 43 App. A (c)(6), (c)(23)" instead of
  the doubled parentheses
- Component total time and time since overhaul are worked out from the
  entry's airframe total time (current times shifted by the difference);
  blank when the entry predates the overhaul; typing them stops the
  automatic updates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 11:40:23 -05:00
1 parent a51f78ebf3
commit 72e1d7760f
22 files changed
+366 -74

No files matched your search

Generated
+13 -1
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2026_11_07_240000) do
ActiveRecord::Schema[8.1].define(version: 2026_11_07_250000) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@@ -480,6 +480,18 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_07_240000) do
t.index ["user_id"], name: "index_logbook_imports_on_user_id"
end
create_table "logbook_templates", force: :cascade do |t|
t.string "name", null: false
t.string "reference"
t.text "text", null: false
t.string "entry_type", default: "MAINTENANCE", null: false
t.string "log_type"
t.string "certificate_type"
t.integer "position", default: 0, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "major_records", force: :cascade do |t|
t.integer "aircraft_id", null: false
t.integer "component_id"