Add & Display Flights
This commit is contained in:
12
app/models/flight.rb
Normal file
12
app/models/flight.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class Flight < ApplicationRecord
|
||||
belongs_to :aircraft
|
||||
validates :to, presence: true
|
||||
validates :from, presence: true
|
||||
validates :tach, presence: true
|
||||
validates :hobbs, presence: true
|
||||
validates :date, presence: true
|
||||
|
||||
def title
|
||||
return aircraft.reg << " - " << date.to_s << " - " << time.to_s
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user