Files
simple-aircraft-manager-rails/db/migrate/20261109010000_add_component_to_ad_alerts.rb
T
rickyandClaude Opus 5.5 d2f5ce1e92 New-AD search covers every installed component
- Besides the aircraft and engine/propeller models (and families), each
  in-use component is searched as maker + model designator and as
  component type + designator (e.g. "Champion 4301", "Magneto 4301"),
  so appliance ADs (magnetos, ELTs, radios, transponders) are found
- A match records the component; tracking it makes the AD apply to that
  component instead of the airframe (ad_alerts.component_id)
- Page hint, guide and README updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:05:07 -05:00

8 lines
319 B
Ruby

class AddComponentToAdAlerts < ActiveRecord::Migration[8.1]
def change
# The installed component whose make/model matched, so tracking the AD
# makes it apply to that component (an appliance AD: magneto, ELT, radio…).
add_reference :ad_alerts, :component, foreign_key: { on_delete: :nullify }
end
end