From e2b6c2fa21cad61340d7f0fae69f92c416c1ecd3 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Fri, 24 Oct 2014 16:22:54 -0200 Subject: [PATCH] profile: Accept nil on short_name --- app/models/profile.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index 7c5a0e9..fc74365 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -741,7 +741,11 @@ private :generate_url, :url_options include ActionView::Helpers::TextHelper def short_name(chars = 40) if self[:nickname].blank? - truncate self.name, :length => chars, :omission => '...' + if chars + truncate self.name, :length => chars, :omission => '...' + else + self.name + end else self[:nickname] end -- libgit2 0.21.2