From c44a7002525d6f87dde923971ac7a95a48e9bc4f Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Apr 2017 12:24:18 -0400 Subject: Quick best practice cleanup of views/helpers (#1546) * Remove trailing whitespace * Use query methods instead of explicit .blank? checks --- app/lib/atom_serializer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/lib/atom_serializer.rb') 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| -- cgit