Skip to content

Commit c16a58d

Browse files
ClearlyClaireGargron
authored andcommitted
Fix User#active scope only returning suspended users (mastodon#11111)
Fix a regression from mastodon#10660
1 parent 1ab1a7e commit c16a58d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class User < ApplicationRecord
8888
scope :confirmed, -> { where.not(confirmed_at: nil) }
8989
scope :enabled, -> { where(disabled: false) }
9090
scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) }
91-
scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where.not(accounts: { suspended_at: nil }) }
91+
scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended_at: nil }) }
9292
scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) }
9393
scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) }
9494

0 commit comments

Comments
 (0)