Commit 15bf0b7ea4b937ac158b58c93d80cfb01bdcfd76
1 parent
77501269
Exists in
master
and in
23 other branches
[comments-refactor-review] Fixing ApproveComment information
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
app/models/approve_comment.rb
| ... | ... | @@ -10,7 +10,7 @@ class ApproveComment < Task |
| 10 | 10 | end |
| 11 | 11 | |
| 12 | 12 | def requestor_name |
| 13 | - requestor ? requestor.name : _('Anonymous') | |
| 13 | + requestor ? requestor.name : (comment.name || _('Anonymous')) | |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | def article |
| ... | ... | @@ -41,7 +41,12 @@ class ApproveComment < Task |
| 41 | 41 | |
| 42 | 42 | def information |
| 43 | 43 | if article |
| 44 | - {:message => _('%{requestor} commented on the the article: %{linked_subject}.') % {:requestor => requestor_name, :linked_subject => linked_subject} } | |
| 44 | + if requestor | |
| 45 | + {:message => _('%{requestor} commented on the the article: %{linked_subject}.')} | |
| 46 | + else | |
| 47 | + { :message => _('%{requestor} commented on the the article: %{linked_subject}.'), | |
| 48 | + :variables => {:requestor => requestor_name} } | |
| 49 | + end | |
| 45 | 50 | else |
| 46 | 51 | {:message => _("The article was removed.")} |
| 47 | 52 | end | ... | ... |