Sha256: c5645cf73e2e0856fb71858a682c29dcc606e6820460c7a4670d40df54bb24e6

Contents?: true

Size: 833 Bytes

Versions: 22

Compression:

Stored size: 833 Bytes

Contents

module Shipit
  class PullRequestsController < ShipitController
    def index
      @pull_requests = stack.pull_requests.queued
    end

    def create
      if pr_number = PullRequest.extract_number(stack, params[:number_or_url])
        pull_request = PullRequest.request_merge!(stack, pr_number, current_user)
        flash[:success] = "Pull request ##{pull_request.number} added to the queue."
      else
        flash[:warning] = "Invalid or missing pull request number."
      end
      redirect_to stack_pull_requests_path
    end

    def destroy
      pull_request = stack.pull_requests.find(params[:id])
      pull_request.cancel!
      flash[:success] = 'Merge canceled'
      redirect_to stack_pull_requests_path
    end

    private

    def stack
      @stack ||= Stack.from_param!(params[:stack_id])
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.30.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.29.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.28.1 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.28.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.27.1 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.27.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.26.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.25.1 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.25.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.24.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.23.1 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.23.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.22.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.21.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.20.1 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.20.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.19.0 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.18.1 app/controllers/shipit/pull_requests_controller.rb
shipit-engine-0.18.0 app/controllers/shipit/pull_requests_controller.rb