phase002 complete

This commit is contained in:
2026-09-15 20:28:07 -06:00
parent 9793cd08bc
commit a3a65c24ed
28 changed files with 656 additions and 13 deletions
+15
View File
@@ -0,0 +1,15 @@
class User < ApplicationRecord
has_many :fuel_entries, foreign_key: :updated_by_user_id, dependent: :restrict_with_error, inverse_of: :updated_by_user
has_many :maintenance_entries, foreign_key: :updated_by_user_id, dependent: :restrict_with_error, inverse_of: :updated_by_user
before_validation :normalize_email
validates :name, presence: true
validates :email, presence: true, uniqueness: { case_sensitive: false }
private
def normalize_email
self.email = email.to_s.strip.downcase if email.present?
end
end