Sha256: 6c14653d70e4c8e82d08e345926e95e8f7f4591b12596f396952ac49ad8ed01d
Contents?: true
Size: 472 Bytes
Versions: 1
Compression:
Stored size: 472 Bytes
Contents
# frozen_string_literals: true module Jobshop class Company::Type < ApplicationRecord self.primary_keys = %i[ organization_id type_id ] after_initialize { self.type_id ||= SecureRandom.uuid if new_record? } belongs_to :organization, inverse_of: :company_types has_many :companies, inverse_of: :type, foreign_key: %i[ organization_id type_id ] validates :name, uniqueness: { scope: :organization_id, case_sensitive: false } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jobshop-0.0.163 | app/models/jobshop/company/type.rb |