You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, currently any Settings that default to boolean true (e.g. admin_only_tenant_creation) cannot be overridden via an environment variable. So, in the case of admin_only_tenant_creation, creating an environment variable SETTINGS__MULTITENANCY__ADMIN_ONLY_TENANT_CREATION=false would have no effect.
This seems to be the result of a bug in the config gem which is described here: rubyconfig/config#178
Simply put, any environment variable overrides that are set to false are ready as "false" (the String), and all Strings are truthy. So, the String "false" becomes boolean true.
The text was updated successfully, but these errors were encountered:
tdonohue
changed the title
Environment variable Setting overrides cannot set values to false
Environment variable setting overrides cannot set values to Boolean false
Oct 19, 2017
All settings in
config/settings.yml
can be overridden using environment variables, as defined inconfig/initializers/config.rb
: https://github.com/samvera-labs/hyku/blob/master/config/initializers/config.rbHowever, currently any Settings that default to boolean
true
(e.g.admin_only_tenant_creation
) cannot be overridden via an environment variable. So, in the case ofadmin_only_tenant_creation
, creating an environment variableSETTINGS__MULTITENANCY__ADMIN_ONLY_TENANT_CREATION=false
would have no effect.This seems to be the result of a bug in the
config
gem which is described here: rubyconfig/config#178Simply put, any environment variable overrides that are set to
false
are ready as "false" (the String), and all Strings are truthy. So, the String "false" becomes booleantrue
.After some discussion with @mjgiarlo, we've decided to try to monkey-patch this method : https://github.com/railsconfig/config/blob/3131b54a8d5efbba88dbced80019a5451f04c708/lib/config/options.rb#L191 We'll also send a patch back to the
config
gem in the hopes that it can properly support Booleans in the future.The text was updated successfully, but these errors were encountered: