Allow plugin to take an etc_type keyword argument for using the TYPE_ETC ubid type, and remove the separate definitions in every model that uses the TYPE_ETC ubid type. This was the cleanest way to DRY things up. You cannot extend the models with a module to do this before including ResourceMethods, because then ResourceMethods::ClassMethods will override it, and you cannot extend the models with a module to do this after including ResourceMethods, because the inclusion will not work correctly due to the eager definition of @ubid_format. Best reviewed without whitespace differences.
23 lines
605 B
Ruby
23 lines
605 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../model"
|
|
|
|
class PrivateSubnetAwsResource < Sequel::Model
|
|
many_to_one :private_subnet, key: :id
|
|
|
|
plugin ResourceMethods
|
|
end
|
|
|
|
# Table: private_subnet_aws_resource
|
|
# Columns:
|
|
# id | uuid | PRIMARY KEY
|
|
# vpc_id | text |
|
|
# subnet_id | text |
|
|
# internet_gateway_id | text |
|
|
# route_table_id | text |
|
|
# security_group_id | text |
|
|
# Indexes:
|
|
# private_subnet_aws_resource_pkey | PRIMARY KEY btree (id)
|
|
# Foreign key constraints:
|
|
# private_subnet_aws_resource_id_fkey | (id) REFERENCES private_subnet(id)
|