]> cat aescling's git repositories - mastodon.git/commitdiff
Avoid dynamic methods due to processing speed (#2080)
author839 <8398a7@gmail.com>
Tue, 18 Apr 2017 13:57:46 +0000 (22:57 +0900)
committerEugen <eugen@zeonfederated.com>
Tue, 18 Apr 2017 13:57:46 +0000 (15:57 +0200)
app/controllers/api_controller.rb
app/models/status.rb

index 478d21bc7b23bdf67e75b645ad25c428ba612828..957e3c3152348bd207327769859bb89300752a0f 100644 (file)
@@ -73,7 +73,7 @@ class ApiController < ApplicationController
   end
 
   def current_user
-    super || current_resource_owner
+    current_resource_owner || super
   rescue ActiveRecord::RecordNotFound
     nil
   end
index a9b7327c359934137a977a9150bbbeea28c5b64f..2d27a57d5129aca0a7a2ea751443a928eb82a1a7 100644 (file)
@@ -42,7 +42,7 @@ class Status < ApplicationRecord
   cache_associated :account, :application, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, :application, :stream_entry, :tags, :media_attachments, mentions: :account], thread: :account
 
   def reply?
-    super || !in_reply_to_id.nil?
+    !in_reply_to_id.nil? || super
   end
 
   def local?