class Airplane attribute :id attribute :capacity, Integer attribute :model_number, Integer attribute :registration_number, Integer attribute :weight, Integer attribute :plane_type belongs_to :hanger belongs_to :owner has_many :maintenances end class Maintenance attribute :id attribute :work_code, String attribute :ended_at, DateTime attribute :started_at, DateTime belongs_to :airplane belongs_to :employee def hours ended_at - started_at end end class Hanger attribute :id attribute :capacity, Integer attribute :location, String attribute :number, Integer belongs_to :employee end class Owner attribute :id attribute :name attribute :address attribute :telephone_number end class Person < Owner attribute :social_insurance_number end class Pilot < Person attribute :license_number has_many :restrictions def airplanes end end class Employee < Person attribute :salary, Float attribute :shift, Integer has_many :plane_types end class Corporation < Owner end class Restriction attribute :id attribute :description, String end