diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/public_body_controller.rb | 4 | ||||
-rw-r--r-- | app/models/public_body.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 02f0ceb19..1f7032eed 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -113,8 +113,8 @@ class PublicBodyController < ApplicationController elsif @tag == 'other' category_list = PublicBodyCategories::get().tags().map{|c| "'"+c+"'"}.join(",") where_condition += base_tag_condition + " AND has_tag_string_tags.name in (#{category_list})) = 0" - elsif @tag.size == 1 - @tag.upcase! + elsif @tag.scan(/./mu).size == 1 + @tag = Unicode.upcase @tag # The first letter queries have to be done on # translations, so just indicate to add that later: first_letter = true diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 828e8c94a..485a794b0 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -71,7 +71,7 @@ class PublicBody < ActiveRecord::Base def PublicBody.set_first_letter(instance) unless instance.name.nil? or instance.name.empty? # we use a regex to ensure it works with utf-8/multi-byte - first_letter = instance.name.scan(/^./mu)[0].upcase + first_letter = Unicode.upcase instance.name.scan(/^./mu)[0] if first_letter != instance.first_letter instance.first_letter = first_letter end |