Ensure feature toggle works for non-logged-in users

This commit is contained in:
Matt-Yorkley
2021-09-05 21:17:15 +01:00
parent 70513ae989
commit e3e53b1504
2 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ module Spree
order.payment_required?
}
go_to_state :confirmation, if: ->(order) {
Flipper.enabled? :split_checkout, order.user
Flipper.enabled? :split_checkout
}
go_to_state :complete
end

View File

@@ -141,7 +141,7 @@ module Spree
private
def validate_shipping_method!
return unless user && Flipper.enabled?(:split_checkout, user)
return unless Flipper.enabled?(:split_checkout)
return if shipping_method.present?
errors.add :shipping_method, I18n.t('split_checkout.errors.select_a_shipping_method')
@@ -149,7 +149,7 @@ module Spree
end
def validate_payment_method!
return unless user && Flipper.enabled?(:split_checkout, user)
return unless Flipper.enabled?(:split_checkout)
return if payments.any?
errors.add :payment_method, I18n.t('split_checkout.errors.select_a_payment_method')