about summary refs log tree commit diff
path: root/app/helpers/atom_builder_helper.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-15 16:56:29 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-15 16:56:29 +0100
commitfdc17bea58f210f62ac0d9e836b68e84c6dbd15c (patch)
tree491613c94695ba867e81d50124e7e3eb73a0eff5 /app/helpers/atom_builder_helper.rb
parenta91c3ef6cef0fe5a1645c043e7d4a5ef96e82c4f (diff)
Fix rubocop issues, introduce usage of frozen literal to improve performance
Diffstat (limited to 'app/helpers/atom_builder_helper.rb')
-rw-r--r--app/helpers/atom_builder_helper.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/atom_builder_helper.rb b/app/helpers/atom_builder_helper.rb
index 2eed2da65..52190adae 100644
--- a/app/helpers/atom_builder_helper.rb
+++ b/app/helpers/atom_builder_helper.rb
@@ -1,6 +1,12 @@
+# frozen_string_literal: true
+
 module AtomBuilderHelper
   def stream_updated_at
-    @account.stream_entries.last ? (@account.updated_at > @account.stream_entries.last.created_at ? @account.updated_at : @account.stream_entries.last.created_at) : @account.updated_at
+    if @account.stream_entries.last
+      (@account.updated_at > @account.stream_entries.last.created_at ? @account.updated_at : @account.stream_entries.last.created_at)
+    else
+      @account.updated_at
+    end
   end
 
   def entry(xml, is_root = false, &block)
@@ -98,7 +104,7 @@ module AtomBuilderHelper
   end
 
   def in_reply_to(xml, uri, url)
-    xml['thr'].send('in-reply-to', { ref: uri, href: url, type: 'text/html' })
+    xml['thr'].send('in-reply-to', ref: uri, href: url, type: 'text/html')
   end
 
   def link_mention(xml, account)