From 9235602496b6cdc61eb17fe1b064e7aefacca1b4 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Wed, 18 Oct 2023 10:40:49 +0200 Subject: [PATCH] rename .to_list to .to_comma_list to fix conflict of https://github.com/alphanodes/additional_tags/issues/56 --- app/controllers/additionals_change_status_controller.rb | 2 +- app/views/wiki/_user_macros.html.slim | 2 +- lib/additionals.rb | 2 +- lib/additionals/helpers.rb | 2 +- test/unit/core_ext_test.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/additionals_change_status_controller.rb b/app/controllers/additionals_change_status_controller.rb index 890d3648..6db34378 100644 --- a/app/controllers/additionals_change_status_controller.rb +++ b/app/controllers/additionals_change_status_controller.rb @@ -26,7 +26,7 @@ def update if !@issue.save || issue_old_status_id == @issue.status_id messages = @issue.errors.full_messages - flash[:error] = messages.present? ? messages.to_list : l(:error_issue_status_could_not_changed) + flash[:error] = messages.present? ? messages.to_comma_list : l(:error_issue_status_could_not_changed) return redirect_to(issue_path(@issue)) end diff --git a/app/views/wiki/_user_macros.html.slim b/app/views/wiki/_user_macros.html.slim index 2c8a621f..0a07e95f 100644 --- a/app/views/wiki/_user_macros.html.slim +++ b/app/views/wiki/_user_macros.html.slim @@ -12,7 +12,7 @@ .user.line = l :field_role ' : - = user_roles[user.id].to_list.html_safe + = user_roles[user.id].to_comma_list.html_safe .user.line = l :field_login ' : diff --git a/lib/additionals.rb b/lib/additionals.rb index 786e77b1..761a028f 100644 --- a/lib/additionals.rb +++ b/lib/additionals.rb @@ -198,7 +198,7 @@ def strip_split(sep = ',') class Array # alias for join with ', ' as seperator - def to_list + def to_comma_list join ', ' end end diff --git a/lib/additionals/helpers.rb b/lib/additionals/helpers.rb index 34fdd8eb..12fc5805 100644 --- a/lib/additionals/helpers.rb +++ b/lib/additionals/helpers.rb @@ -42,7 +42,7 @@ def render_query_description(query) def live_search_title_info(entity) fields = "LiveSearch::#{entity.to_s.classify}".constantize.info_fields - all_fields = fields.map { |f| "#{f}:term" }.to_list + all_fields = fields.map { |f| "#{f}:term" }.to_comma_list l :label_live_search_hints, value: all_fields end diff --git a/test/unit/core_ext_test.rb b/test/unit/core_ext_test.rb index b60e6925..e348a374 100644 --- a/test/unit/core_ext_test.rb +++ b/test/unit/core_ext_test.rb @@ -21,10 +21,10 @@ def test_strip_split_with_empty_string end def test_to_list - assert_equal 'me@localhost, you@localhost', ['me@localhost', 'you@localhost'].to_list + assert_equal 'me@localhost, you@localhost', ['me@localhost', 'you@localhost'].to_comma_list end def test_to_list_with_empty_array - assert_equal '', [].to_list + assert_equal '', [].to_comma_list end end