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.
25 lines
613 B
Ruby
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
|