chore(flipper): enable strict mode and add missing features
This commit is contained in:
parent
dbf93b2ee4
commit
2d22737823
1 changed files with 19 additions and 10 deletions
|
@ -2,11 +2,12 @@
|
||||||
# we can add new features from the Web UI. However when the new DB is created
|
# we can add new features from the Web UI. However when the new DB is created
|
||||||
# this will immediately migrate the default features to be controlled.
|
# this will immediately migrate the default features to be controlled.
|
||||||
def setup_features(features)
|
def setup_features(features)
|
||||||
features.each do |feature|
|
existing = Flipper.preload(features).map { _1.name.to_sym }
|
||||||
if !Flipper.exist?(feature)
|
missing = features - existing
|
||||||
# Disable feature by default
|
|
||||||
Flipper.disable(feature)
|
missing.each do |feature|
|
||||||
end
|
# Feature is disabled by default
|
||||||
|
Flipper.add(feature.to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,13 +15,17 @@ end
|
||||||
features = [
|
features = [
|
||||||
:administrateur_web_hook,
|
:administrateur_web_hook,
|
||||||
:api_particulier,
|
:api_particulier,
|
||||||
:dossier_pdf_vide,
|
:attestation_v2,
|
||||||
:hide_instructeur_email,
|
:blocking_pending_correction,
|
||||||
:procedure_routage_api,
|
|
||||||
:groupe_instructeur_api_hack,
|
|
||||||
:cojo_type_de_champ,
|
:cojo_type_de_champ,
|
||||||
|
:dossier_pdf_vide,
|
||||||
|
:engagement_juridique_type_de_champ,
|
||||||
|
:export_order_by_revision,
|
||||||
|
:expression_reguliere_type_de_champ,
|
||||||
|
:groupe_instructeur_api_hack,
|
||||||
|
:hide_instructeur_email,
|
||||||
:sva,
|
:sva,
|
||||||
:blocking_pending_correction
|
:switch_domain
|
||||||
]
|
]
|
||||||
|
|
||||||
def database_exists?
|
def database_exists?
|
||||||
|
@ -35,3 +40,7 @@ ActiveSupport.on_load(:active_record) do
|
||||||
setup_features(features)
|
setup_features(features)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Rails.application.configure do
|
||||||
|
config.flipper.strict = Rails.env.development?
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue