From 99155dea6194bdf152422d88e6a8dbcda996f7d6 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Thu, 8 Aug 2019 09:57:15 -0400 Subject: [PATCH] Add a method to get all provider create params --- app/models/ext_management_system.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index f0bf2c21bf9..2cfc42b2e73 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -46,6 +46,12 @@ def self.supported_for_create? !reflections.include?("parent_manager") end + def self.provider_create_params + supported_types_for_create.each_with_object({}) do |ems_type, create_params| + create_params[ems_type.name] = ems_type.params_for_create if ems_type.respond_to?(:params_for_create) + end + end + belongs_to :provider has_many :child_managers, :class_name => 'ExtManagementSystem', :foreign_key => 'parent_ems_id'