app/controllers/mass_rollouts_controller.rb
# returns a list of stages already created and list of stages to create (through their template stages)
returns a list of stages already created and list of stages to create (through their template stages)
returns a list of stages already created and list of stages to create ( through their template stages )
def stages_for_creation
    environment = deploy_group.environment
    template_stages = environment.template_stages.all
    deploy_group_stages = deploy_group.stages.all
    preexisting_stages = []
    missing_stages = []
    Project.where(include_new_deploy_groups: true).each do |project|
      template_stage = template_stages.detect { |ts| ts.project_id == project.id }
      deploy_group_stage = deploy_group_stages.detect { |dgs| dgs.project_id == project.id }
      if deploy_group_stage
        preexisting_stages << deploy_group_stage
      elsif template_stage
        missing_stages << template_stage
      end
    end
    [preexisting_stages, missing_stages]
  end
def stages_for_creation environment = deploy_group . environment template_stages = environment . template_stages . all deploy_group_stages = deploy_group . stages . all preexisting_stages = [ ] missing_stages = [ ] Project . where ( include_new_deploy_groups : true ) . each do | project | template_stage = template_stages . detect { | ts | ts . project_id == project . id } deploy_group_stage = deploy_group_stages . detect { | dgs | dgs . project_id == project . id } if deploy_group_stage preexisting_stages << deploy_group_stage elsif template_stage missing_stages << template_stage end end [ preexisting_stages , missing_stages ] end
returns a list of stages already created and list of stages to create (through their template stages)
returns a list of stages already created and list of stages to create ( through their template stages )