parent
685f9d8090
commit
b718803bd9
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the pull_requests controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,36 @@
|
|||||||
|
class PullRequestsController < ApplicationController
|
||||||
|
before_filter :find_project_and_repository
|
||||||
|
before_filter :connect_gitlab, :only => [:index, :show]
|
||||||
|
|
||||||
|
layout "base_projects"
|
||||||
|
|
||||||
|
def index
|
||||||
|
results = @g.merge_requests(@project.gpid)
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def connect_gitlab
|
||||||
|
@g = Gitlab.client
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_project_and_repository
|
||||||
|
@project = Project.find(params[:project_id])
|
||||||
|
render_404 if @project.gpid.blank?
|
||||||
|
@repository = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab")
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module PullRequestsHelper
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe PullRequestsController, :type => :controller do
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in new issue