Skip to content

Commit

Permalink
Merge pull request ManageIQ#17895 from Ladas/refresh_containers_servi…
Browse files Browse the repository at this point in the history
…ce_catalog_entities

Refresh containers service catalog entities
  • Loading branch information
agrare authored Aug 27, 2018
2 parents 01044b9 + 3b772fc commit 5746fa5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def self.api_allowed_attributes
has_many :cloud_subnets, :foreign_key => :ems_id, :dependent => :destroy

has_many :vms_and_templates_advanced_settings, :through => :vms_and_templates, :source => :advanced_settings
has_many :service_offerings, :foreign_key => :ems_id, :dependent => :destroy, :inverse_of => :ext_management_system
has_many :service_parameters_sets, :foreign_key => :ems_id, :dependent => :destroy, :inverse_of => :ext_management_system

validates :name, :presence => true, :uniqueness => {:scope => [:tenant_id]}
validates :hostname, :presence => true, :if => :hostname_required?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ def persistent_volume_claims
add_common_default_values
end

def service_offerings
add_common_default_values
end

def service_parameters_sets
add_common_default_values
end

protected

def custom_reconnect_block
Expand Down
6 changes: 6 additions & 0 deletions app/models/service_offering.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class ServiceOffering < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => "ems_id", :inverse_of => :service_offerings
belongs_to :service_broker

has_many :service_parameters_sets, :dependent => :nullify
end
4 changes: 4 additions & 0 deletions app/models/service_parameters_set.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class ServiceParametersSet < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => "ems_id", :inverse_of => :service_parameters_sets
belongs_to :service_offering
end

0 comments on commit 5746fa5

Please sign in to comment.