validations

This commit is contained in:
Stefan Tollkühn
2025-07-21 17:57:34 +02:00
parent 839d04e824
commit e1129b2430
2 changed files with 4 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ class Subproject < ApplicationRecord
validate :owner_presence_check
validate :builder_presence_check
validates_associated :client, :owner, :builder
def client_attributes=(attributes)
self.client = Client.find_or_initialize_by(email: attributes[:email])
self.client.assign_attributes(attributes)