allow deleting calculated value custom fields without enterprise token

This commit is contained in:
Ivan Kuchin
2026-05-13 17:46:35 +02:00
parent baac6473c5
commit 0f7b6be8ae
2 changed files with 11 additions and 0 deletions
@@ -53,6 +53,10 @@ module CustomFields
validate :not_referenced
def validate_model?
false
end
def not_referenced
referencing = model.class.with_formula_referencing(model)
return if referencing.empty?
@@ -60,4 +60,11 @@ RSpec.describe CustomFields::DeleteContract do
include_examples "contract is invalid", base: :referenced_in_other_fields
end
end
describe "allows deleting a calculated_value field without an enterprise token" do
let(:current_user) { build_stubbed(:admin) }
let(:cf) { build_stubbed(:project_custom_field, field_format: "calculated_value") }
include_examples "contract is valid"
end
end