From 15bf0b7ea4b937ac158b58c93d80cfb01bdcfd76 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Fri, 12 Jul 2013 21:31:45 -0300 Subject: [PATCH] [comments-refactor-review] Fixing ApproveComment information --- app/models/approve_comment.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/models/approve_comment.rb b/app/models/approve_comment.rb index 6e7e77f..3998ad0 100644 --- a/app/models/approve_comment.rb +++ b/app/models/approve_comment.rb @@ -10,7 +10,7 @@ class ApproveComment < Task end def requestor_name - requestor ? requestor.name : _('Anonymous') + requestor ? requestor.name : (comment.name || _('Anonymous')) end def article @@ -41,7 +41,12 @@ class ApproveComment < Task def information if article - {:message => _('%{requestor} commented on the the article: %{linked_subject}.') % {:requestor => requestor_name, :linked_subject => linked_subject} } + if requestor + {:message => _('%{requestor} commented on the the article: %{linked_subject}.')} + else + { :message => _('%{requestor} commented on the the article: %{linked_subject}.'), + :variables => {:requestor => requestor_name} } + end else {:message => _("The article was removed.")} end -- libgit2 0.21.2