diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-02 00:09:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-02 00:09:56 +0000 |
commit | 926711e4546e0cf845c6cbe5773076f2195357f0 (patch) | |
tree | 92edf881d2be503589848c218a85d2a584cf0d19 /app/helpers/tab_helper.rb | |
parent | f7bc7dc5eafc4eef9043a3d1b2dcbc15ca76a571 (diff) | |
download | gitlab-ce-926711e4546e0cf845c6cbe5773076f2195357f0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/tab_helper.rb')
-rw-r--r-- | app/helpers/tab_helper.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb index 1d3242ca44a..e64e1c935dd 100644 --- a/app/helpers/tab_helper.rb +++ b/app/helpers/tab_helper.rb @@ -123,7 +123,21 @@ module TabHelper def route_matches_pages?(pages) Array(pages).compact.any? do |single_page| - current_page?(single_page) + # We need to distinguish between Hash argument and other types of + # arguments (for example String) in order to fix deprecation kwargs + # warning. + # + # This can be refactored to + # + # current_page?(single_page) + # + # When we migrate to Ruby 3 or the Rails version contains the following: + # https://github.com/rails/rails/commit/81d90d81d0ee1fc1a649ab705119a71f2d04c8a2 + if single_page.is_a?(Hash) + current_page?(**single_page) + else + current_page?(single_page) + end end end |