app/models/jobshop/organization.rb in jobshop-0.0.157 vs app/models/jobshop/organization.rb in jobshop-0.0.163

- old
+ new

@@ -1,25 +1,52 @@ +# frozen_string_literals: true + module Jobshop class Organization < ApplicationRecord self.primary_key = :organization_id - has_many :users, inverse_of: :organization, - dependent: :restrict_with_exception - has_many :roles, inverse_of: :organization, - dependent: :restrict_with_exception - has_many :places, inverse_of: :organization, - dependent: :restrict_with_exception has_many :collections, inverse_of: :organization, dependent: :restrict_with_exception - has_many :things, inverse_of: :organization, + + has_many :companies, inverse_of: :organization, dependent: :restrict_with_exception + + has_many :company_types, inverse_of: :organization, + dependent: :restrict_with_exception, + class_name: "Jobshop::Company::Type" + + 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 :companies, inverse_of: :organization, + + has_many :people, 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 scope :grouped_by_email, ->(email_addresses) { Jobshop::User .where(email: email_addresses)