This avoids an exception per class during class loading. For FirewallsPrivateSubnets and CertsLoadBalancers, this defines a ubid_type method when one was previously not defined. This method isn't used, since these models do not have an id field currently. I'm guessing these models only use ResourceMethods for the before_destroy hook, so potentially, that could be moved to a separate module, or we could use a trigger approach to updating the archive table instead of a model hook approach.
32 lines
719 B
Ruby
32 lines
719 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../model"
|
|
|
|
class CertsLoadBalancers < Sequel::Model
|
|
many_to_one :cert
|
|
|
|
def self.ubid_type
|
|
UBID::TYPE_ETC
|
|
end
|
|
|
|
include ResourceMethods
|
|
|
|
def destroy
|
|
DB.transaction do
|
|
cert.incr_destroy
|
|
super
|
|
end
|
|
end
|
|
end
|
|
|
|
# Table: certs_load_balancers
|
|
# Primary Key: (load_balancer_id, cert_id)
|
|
# Columns:
|
|
# load_balancer_id | uuid |
|
|
# cert_id | uuid |
|
|
# Indexes:
|
|
# certs_load_balancers_pkey | PRIMARY KEY btree (load_balancer_id, cert_id)
|
|
# Foreign key constraints:
|
|
# certs_load_balancers_cert_id_fkey | (cert_id) REFERENCES cert(id)
|
|
# certs_load_balancers_load_balancer_id_fkey | (load_balancer_id) REFERENCES load_balancer(id)
|