Files
openfoodnetwork/app/reflexes/enterprise_edit_reflex.rb
Jean-Baptiste Bellet 5cbec5521c Simplify ability
Co-Authored-By: David Cook <david@redcliffs.net>
2023-03-08 10:38:28 +01:00

11 lines
317 B
Ruby

# frozen_string_literal: false
class EnterpriseEditReflex < ApplicationReflex
def remove_terms_and_conditions
@enterprise = Enterprise.find(element.dataset['enterprise-id'])
throw :forbidden unless can?(:remove_terms_and_conditions, @enterprise)
@enterprise.terms_and_conditions.purge_later
end
end