Commit 66d0db2e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'bug/500_pagination' into 'master'

Fix 500 error on project issues and merge requests pages
parents c308b7be e583df54
......@@ -63,7 +63,7 @@ gem "stamp"
gem 'enumerize'
# Pagination
gem "kaminari", "~> 0.14.1"
gem "kaminari", "~> 0.15.1"
# HAML
gem "haml-rails"
......
......@@ -259,7 +259,7 @@ GEM
json (1.8.1)
jwt (0.1.8)
multi_json (>= 1.5)
kaminari (0.14.1)
kaminari (0.15.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.8.1)
......@@ -281,7 +281,7 @@ GEM
minitest (4.7.5)
modernizr (2.6.2)
sprockets (~> 2.0)
multi_json (1.8.2)
multi_json (1.8.4)
multi_xml (0.5.5)
multipart-post (1.2.0)
mysql2 (0.3.11)
......@@ -600,7 +600,7 @@ DEPENDENCIES
jquery-rails (= 2.1.3)
jquery-turbolinks
jquery-ui-rails (= 2.0.2)
kaminari (~> 0.14.1)
kaminari (~> 0.15.1)
launchy
letter_opener
minitest (~> 4.7.0)
......
......@@ -118,8 +118,7 @@ class Projects::IssuesController < Projects::ApplicationController
def issues_filtered
params[:scope] = 'all' if params[:scope].blank?
params[:state] = 'opened' if params[:state].blank?
params[:project_id] = @project.id
@issues = FilteringService.new.execute(Issue, current_user, params)
@issues = FilteringService.new.execute(Issue, current_user, params.merge(project_id: @project.id))
end
# Since iids are implemented only in 6.1
......
......@@ -20,9 +20,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
params[:sort] ||= 'newest'
params[:scope] = 'all' if params[:scope].blank?
params[:state] = 'opened' if params[:state].blank?
params[:project_id] = @project.id
@merge_requests = FilteringService.new.execute(MergeRequest, current_user, params)
@merge_requests = FilteringService.new.execute(MergeRequest, current_user, params.merge(project_id: @project.id))
@merge_requests = @merge_requests.page(params[:page]).per(20)
@sort = params[:sort].humanize
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment