Merge pull request #2620 from basecamp/identity-accounts

Only return identity accounts that are active with an active user
This commit is contained in:
Jay Ohms
2026-02-27 09:48:06 -05:00
committed by GitHub
3 changed files with 29 additions and 2 deletions
+4
View File
@@ -28,6 +28,10 @@ class Identity < ApplicationRecord
end
end
def users_with_active_accounts
users.joins(:account).merge(Account.active).includes(:account)
end
private
def deactivate_users
users.find_each(&:deactivate)
+1 -1
View File
@@ -1,6 +1,6 @@
json.id @identity.id
json.accounts @identity.users do |user|
json.accounts @identity.users_with_active_accounts do |user|
json.partial! "my/identities/account", account: user.account
json.user user, partial: "users/user", as: :user
end