Skip to main content

Register trainee teachers - Configuration

This repo is configured using a file based settings approach via the config gem (see config/settings.yml for an example).

Settings vs Environment variables

Refer to the the config gem to understand the file based settings loading order.

To override file based via Machine based env variables settings

cat config/settings.yml
file
  based
    settings
      env1: 'some file based value'
export SETTINGS__FILE__BASED__SETTINGS__ENV1="machine wins"
puts Settings.file.based.setting.env1

machine wins

Any Machine based env variables settings that is not prefixed with SETTINGS.* are not considered for general consumption.

Feature flags

This repo supports the ability to set up feature flags. To do this, add your feature flag in the settings file under the features property. eg:

features:
  some_feature: true

You can then use the feature service to check whether the feature is enabled or not. Eg. FeatureService.enabled?(:some_feature).

You can also nest features:

features:
  some:
    nested_feature: true

And check with FeatureService.enabled?("some.nested_feature").