diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index 77dbce2de3..12e5f42f54 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -25,6 +25,12 @@ end Flipper.register(:new_2024_07_03) do |actor| actor.respond_to?(:created_at?) && actor.created_at >= "2024-07-03".to_time end +Flipper.register(:enterprise_created_before_2025_07_04) do |actor| + # This group applies to enterprises only, so we return false if the actor is not an Enterprise + next false unless actor.actor.instance_of? Enterprise + + actor.respond_to?(:created_at?) && actor.created_at < "2025-07-04".to_time +end Flipper::UI.configure do |config| config.descriptions_source = ->(_keys) do diff --git a/lib/open_food_network/feature_toggle.rb b/lib/open_food_network/feature_toggle.rb index 4a0d38e552..604f949084 100644 --- a/lib/open_food_network/feature_toggle.rb +++ b/lib/open_food_network/feature_toggle.rb @@ -76,9 +76,6 @@ module OpenFoodNetwork "admin_style_v3" => <<~DESC, Test the work-in-progress design updates. DESC - "inventory" => <<~DESC, - Enable the inventory. - DESC }.freeze def self.setup! diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 4257027014..7f7ef01a12 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -158,9 +158,6 @@ RSpec.configure do |config| config.before(:each) do Flipper.features.each(&:remove) OpenFoodNetwork::FeatureToggle.setup! - # Inventory is currently enabled by default, but we enventually when to disable it by default. - # Disabling it here allows us to test inventory specific code path - Flipper.disable(:inventory) end config.before(:each, :feature) do |example|