Mark attributes set over env var as present if needed

This commit is contained in:
syeopite 2025-08-25 01:35:40 -07:00
parent f978c2b228
commit 245ffc8396
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A

View File

@ -285,6 +285,12 @@ class Config
begin begin
config.{{ivar.id}} = ivar_type.from_yaml(env_value) config.{{ivar.id}} = ivar_type.from_yaml(env_value)
success = true success = true
# Update associated _present key if any
{% other_ivar = @type.instance_vars.find { |other_ivar| other_ivar.name == ivar.name + "_present" } %}
{% if other_ivar && (ann = other_ivar.annotation(YAML::Field)) && ann[:ignore] == true %}
config.{{other_ivar.name.id}} = true
{% end %}
rescue rescue
# nop # nop
end end