diff --git a/app/models/service_template.rb b/app/models/service_template.rb index dad90ee8c49..59e2bc71278 100644 --- a/app/models/service_template.rb +++ b/app/models/service_template.rb @@ -1,4 +1,6 @@ class ServiceTemplate < ApplicationRecord + include SupportsFeatureMixin + DEFAULT_PROCESS_DELAY_BETWEEN_GROUPS = 120 GENERIC_ITEM_SUBTYPES = { @@ -84,6 +86,8 @@ class ServiceTemplate < ApplicationRecord scope :displayed, -> { where(:display => true) } scope :public_service_templates, -> { where(:internal => [false, nil]) } + supports :order + def self.with_tenant(tenant_id) tenant = Tenant.find(tenant_id) where(:tenant_id => tenant.ancestor_ids + [tenant_id]) diff --git a/spec/models/service_template_spec.rb b/spec/models/service_template_spec.rb index 341ab9d73fe..3d8563fa218 100644 --- a/spec/models/service_template_spec.rb +++ b/spec/models/service_template_spec.rb @@ -1113,6 +1113,13 @@ end end end + + context "#supports_order?" do + it "returns the expected boolean value" do + st = FactoryBot.create(:service_template) + expect(st.supports_order?).to eql(true) + end + end end def add_and_save_service(p, c)