mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #13433 from mkllnk/inventory-switch-august-4
Disable inventory only for future enterprises
This commit is contained in:
@@ -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|
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user