Skip to content

Commit

Permalink
Add a method to get all provider create params
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Aug 8, 2019
1 parent 94cde79 commit 2d6f0cb
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 @@ -45,6 +45,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 2d6f0cb

Please sign in to comment.