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" ...@@ -63,7 +63,7 @@ gem "stamp"
gem 'enumerize' gem 'enumerize'
# Pagination # Pagination
gem "kaminari", "~> 0.14.1" gem "kaminari", "~> 0.15.1"
# HAML # HAML
gem "haml-rails" gem "haml-rails"
......
...@@ -259,7 +259,7 @@ GEM ...@@ -259,7 +259,7 @@ GEM
json (1.8.1) json (1.8.1)
jwt (0.1.8) jwt (0.1.8)
multi_json (>= 1.5) multi_json (>= 1.5)
kaminari (0.14.1) kaminari (0.15.1)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
kgio (2.8.1) kgio (2.8.1)
...@@ -281,7 +281,7 @@ GEM ...@@ -281,7 +281,7 @@ GEM
minitest (4.7.5) minitest (4.7.5)
modernizr (2.6.2) modernizr (2.6.2)
sprockets (~> 2.0) sprockets (~> 2.0)
multi_json (1.8.2) multi_json (1.8.4)
multi_xml (0.5.5) multi_xml (0.5.5)
multipart-post (1.2.0) multipart-post (1.2.0)
mysql2 (0.3.11) mysql2 (0.3.11)
...@@ -600,7 +600,7 @@ DEPENDENCIES ...@@ -600,7 +600,7 @@ DEPENDENCIES
jquery-rails (= 2.1.3) jquery-rails (= 2.1.3)
jquery-turbolinks jquery-turbolinks
jquery-ui-rails (= 2.0.2) jquery-ui-rails (= 2.0.2)
kaminari (~> 0.14.1) kaminari (~> 0.15.1)
launchy launchy
letter_opener letter_opener
minitest (~> 4.7.0) minitest (~> 4.7.0)
......
...@@ -118,8 +118,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -118,8 +118,7 @@ class Projects::IssuesController < Projects::ApplicationController
def issues_filtered def issues_filtered
params[:scope] = 'all' if params[:scope].blank? params[:scope] = 'all' if params[:scope].blank?
params[:state] = 'opened' if params[:state].blank? params[:state] = 'opened' if params[:state].blank?
params[:project_id] = @project.id @issues = FilteringService.new.execute(Issue, current_user, params.merge(project_id: @project.id))
@issues = FilteringService.new.execute(Issue, current_user, params)
end end
# Since iids are implemented only in 6.1 # Since iids are implemented only in 6.1
......
...@@ -20,9 +20,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -20,9 +20,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
params[:sort] ||= 'newest' params[:sort] ||= 'newest'
params[:scope] = 'all' if params[:scope].blank? params[:scope] = 'all' if params[:scope].blank?
params[:state] = 'opened' if params[:state].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) @merge_requests = @merge_requests.page(params[:page]).per(20)
@sort = params[:sort].humanize @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