1
|
module ForemanPipeline
|
2
|
module Concerns
|
3
|
module KtEnvironmentExtension
|
4
|
extend ActiveSupport::Concern
|
5
|
|
6
|
included do
|
7
|
has_many :job_to_environments, :class_name => 'ForemanPipeline::JobToEnvironment',
|
8
|
:dependent => :destroy, :foreign_key => :to_environment_id
|
9
|
has_many :jobs, :through => :job_to_environments, :class_name => 'ForemanPipeline::Job', :dependent => :nullify
|
10
|
end
|
11
|
|
12
|
def full_paths
|
13
|
return [self.full_path] unless library?
|
14
|
successors.map(&:full_path)
|
15
|
end
|
16
|
end
|
17
|
end
|
18
|
end
|