about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-12 12:24:18 -0400
committerEugen <eugen@zeonfederated.com>2017-04-12 18:24:18 +0200
commitc44a7002525d6f87dde923971ac7a95a48e9bc4f (patch)
treea47e5c7dbd8555fd216f60f933e1e4f181e0a5a1 /app/lib
parentaa9079838648e9656a1bf8d10151713686e1c0dd (diff)
Quick best practice cleanup of views/helpers (#1546)
* Remove trailing whitespace

* Use query methods instead of explicit .blank? checks
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/atom_serializer.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/lib/atom_serializer.rb b/app/lib/atom_serializer.rb
index 68d2fce68..69e1f153c 100644
--- a/app/lib/atom_serializer.rb
+++ b/app/lib/atom_serializer.rb
@@ -26,8 +26,8 @@ class AtomSerializer
     append_element(author, 'link', nil, rel: :avatar, type: account.avatar_content_type, 'media:width': 120, 'media:height': 120, href: full_asset_url(account.avatar.url(:original)))
     append_element(author, 'link', nil, rel: :header, type: account.header_content_type, 'media:width': 700, 'media:height': 335, href: full_asset_url(account.header.url(:original)))
     append_element(author, 'poco:preferredUsername', account.username)
-    append_element(author, 'poco:displayName', account.display_name) unless account.display_name.blank?
-    append_element(author, 'poco:note', Formatter.instance.simplified_format(account).to_str) unless account.note.blank?
+    append_element(author, 'poco:displayName', account.display_name) if account.display_name?
+    append_element(author, 'poco:note', Formatter.instance.simplified_format(account).to_str) if account.note?
     append_element(author, 'mastodon:scope', account.locked? ? :private : :public)
 
     author
@@ -327,7 +327,7 @@ class AtomSerializer
   end
 
   def serialize_status_attributes(entry, status)
-    append_element(entry, 'summary', status.spoiler_text) unless status.spoiler_text.blank?
+    append_element(entry, 'summary', status.spoiler_text) if status.spoiler_text?
     append_element(entry, 'content', Formatter.instance.format(status.proper).to_str, type: 'html')
 
     status.mentions.each do |mentioned|