Skip to content

Commit

Permalink
rename .to_list to .to_comma_list to fix conflict of alphanodes/addit…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Oct 18, 2023
1 parent 483eb09 commit 9235602
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/additionals_change_status_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/views/wiki/_user_macros.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
' :
Expand Down
2 changes: 1 addition & 1 deletion lib/additionals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/additionals/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/unit/core_ext_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9235602

Please sign in to comment.