]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #4834 - Adjust Status#local and Status#remote scopes (#4839)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 7 Sep 2017 18:18:34 +0000 (20:18 +0200)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2017 18:18:34 +0000 (20:18 +0200)
app/models/status.rb

index fdc230d8f661afa2c4001e73aa122c483fa6a1c4..514cab2e4d57342ff5316ff3f7b11b0fdf18aeea 100644 (file)
@@ -63,8 +63,8 @@ class Status < ApplicationRecord
   default_scope { recent }
 
   scope :recent, -> { reorder(id: :desc) }
-  scope :remote, -> { where.not(uri: nil) }
-  scope :local, -> { where(uri: nil) }
+  scope :remote, -> { where(local: false).or(where.not(uri: nil)) }
+  scope :local,  -> { where(local: true).or(where(uri: nil)) }
 
   scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
   scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') }