diff options
author | Rémy Coutable <remy@rymai.me> | 2017-08-01 10:40:41 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-08-01 16:07:05 +0200 |
commit | f67c7a4da6eb7e363f5433df74016f234999c467 (patch) | |
tree | 6dcc54e8f7aa0f4589c8cafd52b70ebf8bda2ac2 | |
parent | e753444c7341bb9c327aaf7db69a4e612bff0449 (diff) | |
download | gitlab-ce-35769-fix-ruby-2-4-compatibility.tar.gz |
Fix Issue board when using Ruby 2.435769-fix-ruby-2-4-compatibility
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 <remy@rymai.me>
-rw-r--r-- | app/controllers/projects/boards/issues_controller.rb | 3 | ||||
-rw-r--r-- | changelogs/unreleased/35769-fix-ruby-2-4-compatibility.yml | 4 |
2 files changed, 6 insertions, 1 deletions
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: |