Skip to content

Commit

Permalink
Use Organisation#name_with_abbreviation method
Browse files Browse the repository at this point in the history
This wasn't being used in the organisations index. We had custom logic
which resulted in organisations without abbreviations having empty
brackets after their name, which looked odd. This method separates the
name and abbreviation with a dash rather than putting the abbreviation
in brackets, but there doesn't seem to be an obvious reason why both
uses can't be the same

The dash used in the method was a non-standard character, so that's
fixed here
  • Loading branch information
yndajas committed Sep 19, 2024
1 parent 90152a9 commit 4b1f0f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/organisation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Organisation < ApplicationRecord

def name_with_abbreviation
return_value = if abbreviation.present? && abbreviation != name
"#{name} #{abbreviation}"
"#{name} - #{abbreviation}"
else
name
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/organisations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= t.body do %>
<% @organisations.each do |organisation| %>
<%= t.row do %>
<%= t.cell "#{organisation.name} (#{organisation.abbreviation})" %>
<%= t.cell "#{organisation.name_with_abbreviation}" %>
<%= t.cell organisation.organisation_type %>
<%= t.cell organisation.slug %>
<td class="govuk-table__cell">
Expand Down

0 comments on commit 4b1f0f7

Please sign in to comment.