From 252f8094638c13564f145a230fe86f4f93f74113 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 28 Jul 2023 16:19:42 +1000 Subject: [PATCH] Require CustomTab.belongs_to by default --- app/models/custom_tab.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/custom_tab.rb b/app/models/custom_tab.rb index 22058efcc1..321ae0a5a2 100644 --- a/app/models/custom_tab.rb +++ b/app/models/custom_tab.rb @@ -1,7 +1,9 @@ # frozen_string_literal: false class CustomTab < ApplicationRecord - belongs_to :enterprise, optional: false + self.belongs_to_required_by_default = true + + belongs_to :enterprise validates :title, presence: true, length: { maximum: 20 } end