From 83c0c7d3f97de5c464e5254d9b6ab2d5458f303f Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Fri, 24 Aug 2018 15:40:47 +0200 Subject: [PATCH] Rename ServiceCLass to ServiceOffering --- app/models/ext_management_system.rb | 2 +- .../inventory_collection/builder/container_manager.rb | 8 ++++---- app/models/service_instance.rb | 2 +- app/models/{service_class.rb => service_offering.rb} | 4 ++-- app/models/service_plan.rb | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename app/models/{service_class.rb => service_offering.rb} (72%) diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index aa51e63c1588..4266e6fe3441 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -78,7 +78,7 @@ def self.api_allowed_attributes has_many :miq_events, :as => :target, :dependent => :destroy has_many :cloud_subnets, :foreign_key => :ems_id, :dependent => :destroy - has_many :service_classes, :foreign_key => :ems_id, :dependent => :destroy, :inverse_of => :ext_management_system + has_many :service_offerings, :foreign_key => :ems_id, :dependent => :destroy, :inverse_of => :ext_management_system has_many :service_instances, :foreign_key => :ems_id, :dependent => :destroy, :inverse_of => :ext_management_system has_many :service_plans, :foreign_key => :ems_id, :dependent => :destroy, :inverse_of => :ext_management_system diff --git a/app/models/manager_refresh/inventory_collection/builder/container_manager.rb b/app/models/manager_refresh/inventory_collection/builder/container_manager.rb index a7e0742c8711..247d15a0e25c 100644 --- a/app/models/manager_refresh/inventory_collection/builder/container_manager.rb +++ b/app/models/manager_refresh/inventory_collection/builder/container_manager.rb @@ -228,21 +228,21 @@ def persistent_volume_claims add_common_default_values end - def service_classes + def service_offerings add_properties( - :model_class => ::ServiceClass, + :model_class => ::ServiceOffering, ) add_common_default_values end - def container_service_plans + def service_plans add_properties( :model_class => ::ServicePlan, ) add_common_default_values end - def container_service_instances + def service_instances add_properties( :model_class => ::ServiceInstance, ) diff --git a/app/models/service_instance.rb b/app/models/service_instance.rb index cbaa3ad7b81b..4f3fbdc5ee73 100644 --- a/app/models/service_instance.rb +++ b/app/models/service_instance.rb @@ -1,5 +1,5 @@ class ServiceInstance < ApplicationRecord belongs_to :ext_management_system, :foreign_key => "ems_id", :inverse_of => :service_instances - belongs_to :service_class + belongs_to :service_offering belongs_to :service_plan end diff --git a/app/models/service_class.rb b/app/models/service_offering.rb similarity index 72% rename from app/models/service_class.rb rename to app/models/service_offering.rb index a8636e8c4dcb..f1a0571c970c 100644 --- a/app/models/service_class.rb +++ b/app/models/service_offering.rb @@ -1,5 +1,5 @@ -class ServiceClass < ApplicationRecord - belongs_to :ext_management_system, :foreign_key => "ems_id", :inverse_of => :service_classes +class ServiceOffering < ApplicationRecord + belongs_to :ext_management_system, :foreign_key => "ems_id", :inverse_of => :service_offerings belongs_to :service_broker has_many :service_plans, :dependent => :nullify diff --git a/app/models/service_plan.rb b/app/models/service_plan.rb index 83883c50cec1..6e55aa32d7b0 100644 --- a/app/models/service_plan.rb +++ b/app/models/service_plan.rb @@ -1,6 +1,6 @@ class ServicePlan < ApplicationRecord belongs_to :ext_management_system, :foreign_key => "ems_id", :inverse_of => :service_plans - belongs_to :service_class + belongs_to :service_offering has_many :service_instances, :dependent => :nullify end