Skip to content

Commit

Permalink
Merge pull request #19120 from agrare/add_common_validate_credentials…
Browse files Browse the repository at this point in the history
…_api

Add a common validate_credentials API and method for getting all provider create params
  • Loading branch information
Fryguy authored Sep 4, 2019
2 parents e5f6647 + 99155de commit af86aa6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit af86aa6

Please sign in to comment.