Skip to content

Commit

Permalink
Hide region from Cloud provider forms if it's not required
Browse files Browse the repository at this point in the history
If Cloud provider clearly states `:reqion_required?` as false, don't
show the Region dropdown in add provider dialogue.
  • Loading branch information
tumido committed Feb 26, 2018
1 parent 6c8e07a commit 34a4283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/ems_common.rb
Expand Up @@ -469,7 +469,7 @@ def form_instance_vars
end

def retrieve_provider_regions
managers = model.supported_subclasses.select(&:supports_regions?)
managers = model.supported_subclasses.select { |s| s.supports_regions? && s.try(:region_required?) != false }
managers.each_with_object({}) do |manager, provider_regions|
regions = manager.parent::Regions.all.sort_by { |r| r[:description] }
provider_regions[manager.ems_type] = regions.map do |region|
Expand Down

0 comments on commit 34a4283

Please sign in to comment.