Skip to content

Commit

Permalink
Add Pod to PersistentVolume relationship
Browse files Browse the repository at this point in the history
refactoring
  • Loading branch information
nimrodshn committed May 8, 2017
1 parent 031e34d commit 31ae27a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/container_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ContainerGroup < ApplicationRecord
belongs_to :old_container_project, :foreign_key => "old_container_project_id", :class_name => 'ContainerProject'
belongs_to :container_build_pod
has_many :container_volumes, :as => :parent, :dependent => :destroy
has_many :persistent_volume_claim, :through => :container_volumes
has_many :persistent_volumes, -> { where(:type=>'PersistentVolume') }, :through => :persistent_volume_claim, :source => :container_volumes

# Metrics destroy is handled by purger
has_many :metrics, :as => :resource
Expand Down

0 comments on commit 31ae27a

Please sign in to comment.