나는 계정 집합을 갖고 있으며, 쿼리의 NOT IN 연산에서 사용할 수 있도록 모든 ID를 arry에 수집하려고합니다. 어떤 도움을 주시면 감사하겠습니다.배열의 계정 ID 수집
@alreadyonteam = @team.accounts.collect { || . }
내 쿼리 :
@friends = Account.find(current_account.id).active_friends.where('id not in (?)',@alreadyonteam).search(params[:search])
'@alreadyonteam = @ team.account_ids' 그리고 그건 그것. – blelump
감사합니다! 그것은 – MMrj
@blelump를 해결했습니다. – tadman