From f67c7a4da6eb7e363f5433df74016f234999c467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 1 Aug 2017 10:40:41 +0200 Subject: [PATCH] Fix Issue board when using Ruby 2.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Ruby 2.4, Hash#compact exists and returns a Hash, while in Ruby 2.3, Hash#compact is implemented by Rails and returns a new `ActionController::Parameters` instance in this case. Also, `ActionController::Parameters#compact` is deprecated in Rails 5.1 so we're using `reject { |_, value| value.nil? }` instead. Signed-off-by: Rémy Coutable --- app/controllers/projects/boards/issues_controller.rb | 3 ++- changelogs/unreleased/35769-fix-ruby-2-4-compatibility.yml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/35769-fix-ruby-2-4-compatibility.yml diff --git a/app/controllers/projects/boards/issues_controller.rb b/app/controllers/projects/boards/issues_controller.rb index da9b789d617..653e7bc7e40 100644 --- a/app/controllers/projects/boards/issues_controller.rb +++ b/app/controllers/projects/boards/issues_controller.rb @@ -66,7 +66,8 @@ module Projects end def filter_params - params.merge(board_id: params[:board_id], id: params[:list_id]).compact + params.merge(board_id: params[:board_id], id: params[:list_id]) + .reject { |_, value| value.nil? } end def move_params diff --git a/changelogs/unreleased/35769-fix-ruby-2-4-compatibility.yml b/changelogs/unreleased/35769-fix-ruby-2-4-compatibility.yml new file mode 100644 index 00000000000..ac480993d85 --- /dev/null +++ b/changelogs/unreleased/35769-fix-ruby-2-4-compatibility.yml @@ -0,0 +1,4 @@ +--- +title: Fix Issue board when using Ruby 2.4 +merge_request: 13220 +author: