From dace1403e047b9cd1b6bd993ba06cd017dd374c4 Mon Sep 17 00:00:00 2001 From: Mark Bussey Date: Tue, 31 Aug 2021 17:58:15 -0500 Subject: [PATCH] Define a New_UI feature for local testing We've implemented a New_UI feature in Flipflop in tenejo, but want to beging implementing UI changes in zizia directly. This change allows us to code and test against the feature (disabled or enabled) directly in the engine. --- config/features.rb | 6 ++++++ lib/zizia/engine.rb | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 config/features.rb diff --git a/config/features.rb b/config/features.rb new file mode 100644 index 0000000..fed4c45 --- /dev/null +++ b/config/features.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true +Flipflop.configure do + feature :new_ui, + default: false, + description: "Show new UI features and workflows." +end diff --git a/lib/zizia/engine.rb b/lib/zizia/engine.rb index 97ffb35..807ee25 100644 --- a/lib/zizia/engine.rb +++ b/lib/zizia/engine.rb @@ -20,6 +20,10 @@ class Engine < ::Rails::Engine app.config.assets.precompile << %w[zizia/application.js zizia/application.css] end + initializer "load_features" do + Flipflop::FeatureLoader.current.append(self) + end + initializer :append_migrations do |app| unless app.root.to_s.match root.to_s config.paths['db/migrate'].expanded.each do |expanded_path|