From 7614e3eb7c32507f184df53257162c6362c3cf3a Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Fri, 13 Jul 2018 17:14:03 -0400 Subject: [PATCH] Followup to PR 17695 This gets the API repo tests passing again --- app/models/container.rb | 2 +- app/models/container_group.rb | 2 +- app/models/container_image.rb | 2 +- app/models/container_node.rb | 2 +- app/models/container_project.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/container.rb b/app/models/container.rb index 3536c26600c..e1fd3492eae 100644 --- a/app/models/container.rb +++ b/app/models/container.rb @@ -20,7 +20,7 @@ class Container < ApplicationRecord has_many :metrics, :as => :resource has_many :metric_rollups, :as => :resource has_many :vim_performance_states, :as => :resource - delegate :my_zone, :to => :ext_management_system + delegate :my_zone, :to => :ext_management_system, :allow_nil => true include EventMixin include Metric::CiMixin diff --git a/app/models/container_group.rb b/app/models/container_group.rb index 0abe079a046..4e561d4eb5a 100644 --- a/app/models/container_group.rb +++ b/app/models/container_group.rb @@ -33,7 +33,7 @@ class ContainerGroup < ApplicationRecord has_many :metrics, :as => :resource has_many :metric_rollups, :as => :resource has_many :vim_performance_states, :as => :resource - delegate :my_zone, :to => :ext_management_system + delegate :my_zone, :to => :ext_management_system, :allow_nil => true virtual_column :ready_condition_status, :type => :string, :uses => :container_conditions virtual_column :running_containers_summary, :type => :string diff --git a/app/models/container_image.rb b/app/models/container_image.rb index b0292dbe6fa..200d3771612 100644 --- a/app/models/container_image.rb +++ b/app/models/container_image.rb @@ -37,7 +37,7 @@ class ContainerImage < ApplicationRecord after_create :raise_creation_event - delegate :my_zone, :to => :ext_management_system + delegate :my_zone, :to => :ext_management_system, :allow_nil => true def full_name return docker_id if image_ref && image_ref.start_with?(DOCKER_PULLABLE_PREFIX) diff --git a/app/models/container_node.rb b/app/models/container_node.rb index 7e0b4a0514b..38d71e210d6 100644 --- a/app/models/container_node.rb +++ b/app/models/container_node.rb @@ -32,7 +32,7 @@ class ContainerNode < ApplicationRecord has_many :metric_rollups, :as => :resource has_many :vim_performance_states, :as => :resource has_many :miq_alert_statuses, :as => :resource - delegate :my_zone, :to => :ext_management_system + delegate :my_zone, :to => :ext_management_system, :allow_nil => true virtual_column :ready_condition_status, :type => :string, :uses => :container_conditions diff --git a/app/models/container_project.rb b/app/models/container_project.rb index 8ae04712316..d5e89d67cdd 100644 --- a/app/models/container_project.rb +++ b/app/models/container_project.rb @@ -46,7 +46,7 @@ class ContainerProject < ApplicationRecord PERF_ROLLUP_CHILDREN = :all_container_groups - delegate :my_zone, :to => :ext_management_system + delegate :my_zone, :to => :ext_management_system, :allow_nil => true def all_container_groups ContainerGroup.where(:container_project_id => id).or(ContainerGroup.where(:old_container_project_id => id))