Many Changes: Rename privacy_policy, fixed seed.rb, fixed status in migration file, created new job for operator

This commit is contained in:
2024-09-09 14:35:07 +02:00
parent cf8cc196a3
commit c195cd3b22
11 changed files with 59 additions and 44 deletions

View File

@@ -4,11 +4,10 @@ class Job < ApplicationRecord
has_one_attached :pdf, dependent: :purge
validates_presence_of :costumer_firstname, :costumer_lastname, :privacy_policy_accepted, :pdf
# validates_numericality_of {:number_of_plans_a0,:number_of_plans_a1, :number_of_plans_a2, :number_of_plans_a3}, greater_than_or_equal_to: 0
validates_presence_of :costumer_firstname, :costumer_lastname, :pdf
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, numericality: { greater_than_or_equal_to: 0 }
validate :acceptable_pdf
before_save :update_printed_at, if: :will_save_change_to_status?