Skip to content

Commit

Permalink
Change display to visible
Browse files Browse the repository at this point in the history
The column was renamed on Service but not on ServiceTemplate
  • Loading branch information
bdunne committed Oct 1, 2019
1 parent 9c72451 commit 781a3d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/models/service_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,18 @@ def config_info

def create_service(service_task, parent_svc = nil)
nh = attributes.dup

# Service#display was renamed to #visible in https://github.com/ManageIQ/manageiq-schema/pull/410
nh['visible'] = nh.delete('display') if nh.key?('display')

nh['options'][:dialog] = service_task.options[:dialog]
(nh.keys - Service.column_names + %w(created_at guid service_template_id updated_at id type prov_type)).each { |key| nh.delete(key) }

# Hide child services by default
nh['display'] = false if parent_svc
nh['visible'] = false if parent_svc

# If display is nil, set it to false
nh['display'] ||= false
# If visible is nil, set it to false
nh['visible'] ||= false

# convert template class name to service class name by naming convention
nh['type'] = self.class.name.sub('Template', '')
Expand Down

0 comments on commit 781a3d5

Please sign in to comment.