Open OlegChuev opened 5 months ago
Yeah, makes sense.
The way we should do that is as follows:
Add a global setting to disable validations, smth like: Anyway::Settings.suppress_required_validations = true
(or config.anyway_config.suppress_required_validations = true
)
Use some custom env var to toggle this setting, e.g., ANYWAY_SUPPRESS_VALIDATIONS=true
For Rails apps, set this parameter to true if the SECRET_KEY_BASE_DUMMY
is defined (and ANYWAY_SUPPRESS_VALIDATIONS
is not).
@palkan I could start working on this feature if you don't mind
Is your feature request related to a problem? Please describe.
The main idea is to add support for the Rails built-in environment variable
SECRET_KEY_BASE_DUMMY
. If a user has added this variable, we skip any kind of validations for required attributes. This could be useful for executingbundle exec rails assets:precompile
in CI/CD pipelines.Describe the solution you'd like
As far as I can see (I'm not very familiar with the gem's codebase), we could add an additional condition to the
validate_required_attributes
method:Describe alternatives you've considered
-
Additional context
-