aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-08-17 12:51:30 +0200
committerDavid Cabo <david@calibea.com>2011-08-17 12:51:30 +0200
commite97c2d1b664dec8e04dd372f176feb0a0efd8cf9 (patch)
tree3efb47467fe32e7518960c611abe81c932bcb8e5 /app/models
parente1a2e1ad36c6b0c7bfac501eb2a0d0ae5efd05a1 (diff)
Draft UI for tabbed multi-locale public body handling
Diffstat (limited to 'app/models')
-rw-r--r--app/models/public_body.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index e90050688..b4d1b6704 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -53,7 +53,7 @@ class PublicBody < ActiveRecord::Base
# XXX - Don't like repeating this!
def calculate_cached_fields(t)
- t.first_letter = t.name.scan(/^./mu)[0].upcase
+ t.first_letter = t.name.scan(/^./mu)[0].upcase unless t.name.nil? or t.name.empty?
short_long_name = t.name
short_long_name = t.short_name if t.short_name and !t.short_name.empty?
t.url_name = MySociety::Format.simplify_url_part(short_long_name, 'body')