diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/helpers/tab_helper.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
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 |