qi6_app/app/models/p_truck.rb
2019-05-17 12:30:45 +02:00

13 lines
230 B
Ruby

class PTruck < ApplicationRecord
has_many :p_truck_spaces
belongs_to :p_driver
accepts_nested_attributes_for :p_truck_spaces, allow_destroy: true
def name
self.marque.to_s + " " + self.immat.to_s
end
end