Merge pull request #13433 from mkllnk/inventory-switch-august-4

Disable inventory only for future enterprises
This commit is contained in:
Gaetan Craig-Riou
2025-07-28 12:02:54 +10:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -25,11 +25,11 @@ 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|
Flipper.register(:enterprise_created_before_2025_08_11) 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
actor.respond_to?(:created_at?) && actor.created_at < "2025-08-11".to_time
end
Flipper::UI.configure do |config|

View File

@@ -3,11 +3,11 @@
class EnableFeatureInventoryForExistingEnterprises < ActiveRecord::Migration[7.0]
# rubocop:disable Naming/VariableNumber
def up
Flipper.enable_group(:inventory, :enterprise_created_before_2025_07_04)
Flipper.enable_group(:inventory, :enterprise_created_before_2025_08_11)
end
def down
Flipper.disable_group(:inventory, :enterprise_created_before_2025_07_04)
Flipper.disable_group(:inventory, :enterprise_created_before_2025_08_11)
end
# rubocop:enable Naming/VariableNumber
end