Closed uchouhan closed 11 months ago
@uchouhan since bin/rails credentials:edit
loads the rails environment, it is going to load the config and run the required
validations, causing the error you mentioned if it is not defined. I would imagine the only way around this would be a change the bin/rails
command to not call the railties that anyway_config
uses, when rails runs credentials:edit
.
What did you do?
added a rails credential called
my_credential
added arequired :my_credential
to theMyConfig
classWhat did you expect to happen?
be able to edit credential
rails credentials:edit -e local
What actually happened?
raises a validation error
The following config parameters for MyConfig(config_name: my) are missing or empty: my_credential
Additional context
passing in an environment variable works
MY_CREDENTIAL=test rails credentials:edit -e local
however, not all our credentials will have environment variablesEnvironment
Ruby Version: 3.2.2
Framework Version (Rails, whatever): 7.0.8
Anyway Config Version: 2.5.4