From 25b40f99d5fba9f65115435e7997f0b6e44ef327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=B6hm?= Date: Mon, 7 Oct 2024 10:05:45 +0200 Subject: [PATCH] PDF not required if operator created job --- app/models/job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/job.rb b/app/models/job.rb index 4c9a13c..b551e0e 100644 --- a/app/models/job.rb +++ b/app/models/job.rb @@ -8,8 +8,9 @@ class Job < ApplicationRecord has_one_attached :pdf, dependent: :purge - validates_presence_of :customer_firstname, :customer_lastname, :pdf + validates_presence_of :customer_firstname, :customer_lastname validates_presence_of :cost_center, if: :intern + validates_presence_of :pdf, unless: :created_by_operator? validates :privacy_policy, acceptance: true, unless: :created_by_operator? validates :number_of_plans_a0, :number_of_plans_a1, :number_of_plans_a2, :number_of_plans_a3, :costum_qm_plan, numericality: { greater_than_or_equal_to: 0 }