From f3836948706865726782e53c4acb7d16e7e7bd44 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Wed, 11 Dec 2024 00:08:26 +0100 Subject: [PATCH] feat: add support for tracking inherited filesystem config subclasses --- src/models/abstract_filesystem_config.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/models/abstract_filesystem_config.cr b/src/models/abstract_filesystem_config.cr index 928a0d7..66081ee 100644 --- a/src/models/abstract_filesystem_config.cr +++ b/src/models/abstract_filesystem_config.cr @@ -15,6 +15,15 @@ module GX::Models abstract class AbstractFilesystemConfig include YAML::Serializable # include YAML::Serializable::Strict + @@subs = [] of AbstractFilesystemConfig.class + + macro inherited + @@subs << {{@type.name.id}} + end + + def self.subs + @@subs + end use_yaml_discriminator "type", { gocryptfs: GoCryptFSConfig,