Skip to content

Commit 67a1eb0

Browse files
committed
fix deprecated distro link with dot
1 parent dac28ff commit 67a1eb0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/models/distro.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def all_active
1515
end
1616

1717
def by_id(id)
18-
find { |i| i.id == id.to_s } || (raise "no such distro '#{id}'")
18+
id = id.to_s.gsub('%2E', '.')
19+
find { |i| i.id == id } || (raise "no such distro '#{id}'")
1920
end
2021
alias [] by_id
2122

@@ -77,6 +78,10 @@ def deprecated?
7778
config['deprecated'].present?
7879
end
7980

81+
def url_safe_id
82+
id.gsub('.', '%2E')
83+
end
84+
8085
private
8186

8287
attr_reader :config

app/views/repositories/_depricated_note.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<% if distro.deprecated? %>
44
<span class="text-warning">Deprecated
5-
<%= link_to deprecated_distro_path_path(distro.id) do %>
5+
<%= link_to deprecated_distro_path_path(distro.url_safe_id) do %>
66
<i class="bi bi-question-circle-fill"></i>
77
<% end %>
88
</span>

0 commit comments

Comments
 (0)