Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add has_many for annotations custom attribute each summary page that contains labels #23074

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/container_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class ContainerGroup < ApplicationRecord
has_many :containers, :dependent => :destroy
has_many :container_images, -> { distinct }, :through => :containers
belongs_to :ext_management_system, :foreign_key => "ems_id"
has_many :annotations, -> { where(:section => "annotations") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
:inverse_of => :resource
has_many :labels, -> { where(:section => "labels") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
Expand Down
4 changes: 4 additions & 0 deletions app/models/container_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class ContainerNode < ApplicationRecord
has_many :container_services, -> { distinct }, :through => :container_groups
has_many :container_routes, -> { distinct }, :through => :container_services
has_many :container_replicators, -> { distinct }, :through => :container_groups
has_many :annotations, -> { where(:section => "annotations") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
:inverse_of => :resource
has_many :labels, -> { where(:section => "labels") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
Expand Down
4 changes: 4 additions & 0 deletions app/models/container_replicator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class ContainerReplicator < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => "ems_id"
has_many :container_groups
belongs_to :container_project
has_many :annotations, -> { where(:section => "annotations") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
:inverse_of => :resource
has_many :labels, -> { where(:section => "labels") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
Expand Down
4 changes: 4 additions & 0 deletions app/models/container_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class ContainerRoute < ApplicationRecord
belongs_to :container_service
has_many :container_nodes, -> { distinct }, :through => :container_service
has_many :container_groups, -> { distinct }, :through => :container_service
has_many :annotations, -> { where(:section => "annotations") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
:inverse_of => :resource
has_many :labels, -> { where(:section => "labels") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
Expand Down
4 changes: 4 additions & 0 deletions app/models/container_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ class ContainerService < ApplicationRecord
has_many :container_routes
has_many :container_service_port_configs, :dependent => :destroy
belongs_to :container_project
has_many :annotations, -> { where(:section => "annotations") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
:inverse_of => :resource
has_many :labels, -> { where(:section => "labels") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
Expand Down
4 changes: 4 additions & 0 deletions app/models/container_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class ContainerTemplate < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => "ems_id"
belongs_to :container_project
has_many :container_template_parameters, :dependent => :destroy
has_many :annotations, -> { where(:section => "annotations") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
:inverse_of => :resource
has_many :labels, -> { where(:section => "labels") }, # rubocop:disable Rails/HasManyOrHasOneDependent
:class_name => "CustomAttribute",
:as => :resource,
Expand Down