b80dd3d242
Merge branch 'master' into non-interactive-aws-install Conflicts: doc/installation.md Fix merge mess in installation.md
17 lines
550 B
Ruby
17 lines
550 B
Ruby
class MergeRequestsLoad < BaseContext
|
|
def execute
|
|
type = params[:f]
|
|
|
|
merge_requests = project.merge_requests
|
|
|
|
merge_requests = case type
|
|
when 'all' then merge_requests
|
|
when 'closed' then merge_requests.closed
|
|
when 'assigned-to-me' then merge_requests.opened.assigned(current_user)
|
|
else merge_requests.opened
|
|
end.page(params[:page]).per(20)
|
|
|
|
merge_requests.includes(:author, :project).order("closed, created_at desc")
|
|
end
|
|
end
|