1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
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
|