# frozen_string_literal: true module Jobshop class Organization < ApplicationRecord include Auditing has_many :collections, inverse_of: :organization, dependent: :restrict_with_exception has_many :customers, inverse_of: :organization, dependent: :restrict_with_exception has_many :customer_categories, inverse_of: :organization, dependent: :restrict_with_exception, class_name: "Jobshop::Customer::Category" has_many :customer_contacts, inverse_of: :organization, dependent: :restrict_with_exception, class_name: "Jobshop::Customer::Contact" has_many :departments, inverse_of: :organization, dependent: :restrict_with_exception has_many :employees, inverse_of: :organization, dependent: :restrict_with_exception has_many :employments, inverse_of: :organization, dependent: :restrict_with_exception has_many :inspection_reports, inverse_of: :organization, dependent: :restrict_with_exception, class_name: "Jobshop::Inspection::Report" has_many :mailmen, inverse_of: :organization, dependent: :restrict_with_exception has_many :orders, inverse_of: :organization, dependent: :restrict_with_exception has_many :places, inverse_of: :organization, dependent: :restrict_with_exception has_many :products, inverse_of: :organization, dependent: :restrict_with_exception has_many :rfqs, inverse_of: :organization, dependent: :restrict_with_exception has_many :roles, inverse_of: :organization, dependent: :restrict_with_exception has_many :routing_processes, inverse_of: :organization, dependent: :restrict_with_exception has_many :things, inverse_of: :organization, dependent: :restrict_with_exception has_many :users, inverse_of: :organization, dependent: :restrict_with_exception validates :name, presence: true end end