Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Matt <lukas@zauberstuhl.de>2014-03-23 00:01:34 +0400
committerLukas Matt <lukas@zauberstuhl.de>2014-05-15 15:23:43 +0400
commit6f21ccda064f749a7feca01224a7d91445ccc91b (patch)
tree0e36293c9036eeed79a0bd88a5da79020b71ff60
parent26d0c81dae88370b5efd1d10a813eb157eb580ab (diff)
Using case instead of equal
-rw-r--r--app/helpers/report_helper.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/report_helper.rb b/app/helpers/report_helper.rb
index 91b94e49f..3d8ee929b 100644
--- a/app/helpers/report_helper.rb
+++ b/app/helpers/report_helper.rb
@@ -4,10 +4,11 @@
module ReportHelper
def report_content(id, type)
- if type.eql? "post"
- raw t('report.post_label', title: link_to(post_page_title(Post.find_by_id(id)), post_path(id)))
- elsif type.eql? "comment"
- raw t('report.comment_label', data: comment_message(Comment.find_by_id(id)))
+ raw case type
+ when 'post'
+ t('report.post_label', title: link_to(post_page_title(Post.find_by_id(id)), post_path(id)))
+ when 'comment'
+ t('report.comment_label', data: comment_message(Comment.find_by_id(id)))
end
end
end