Finished phase005
CI / scan_ruby (push) Failing after 1m5s
CI / scan_js (push) Failing after 6s
CI / lint (push) Failing after 1m29s

This commit is contained in:
2026-09-16 15:34:50 -06:00
parent a3a65c24ed
commit 0826d267f2
38 changed files with 1596 additions and 9 deletions
+5 -1
View File
@@ -3,7 +3,7 @@ class Vehicle < ApplicationRecord
has_many :fuel_entries, dependent: :restrict_with_error
has_many :maintenance_entries, dependent: :restrict_with_error
before_validation :normalize_vin
before_validation :normalize_vin, :normalize_licence_plate
validates :make, :model, :color, :vin, :licence_plate, presence: true
validates :vin, uniqueness: true
@@ -19,4 +19,8 @@ class Vehicle < ApplicationRecord
def normalize_vin
self.vin = vin.to_s.strip.upcase if vin.present?
end
def normalize_licence_plate
self.licence_plate = licence_plate.to_s.strip.upcase if licence_plate.present?
end
end