Files
ubicloud/model/cert.rb
Jeremy Evans 7ca153cd38 Avoid unnecessary autoloads in model files
In most cases, use class names instead of class references.  This
works better as it avoids stale class references when using
Unreloader (which does incremental reloading).

This inlines the :applied_tag and :access_tag table names, instead
of using {AppliedTag,AccessTag}.table_name, also to avoid
unnecessary autoloading.
2024-10-24 07:55:06 -07:00

25 lines
613 B
Ruby

# frozen_string_literal: true
require_relative "../model"
class Cert < Sequel::Model
one_through_one :load_balancer, join_table: :certs_load_balancers, left_key: :cert_id, right_key: :load_balancer_id
one_to_one :certs_load_balancers, key: :cert_id, class: :CertsLoadBalancers
one_to_one :strand, key: :id
plugin :association_dependencies, certs_load_balancers: :destroy
include ResourceMethods
include SemaphoreMethods
semaphore :destroy
plugin :column_encryption do |enc|
enc.column :account_key
enc.column :csr_key
end
def self.redacted_columns
super + [:cert]
end
end