Skip to content
Extraits de code Groupes Projets
Valider f10feb2e rédigé par Eugen Rochko's avatar Eugen Rochko
Parcourir les fichiers

Fix common followers API

parent e8ff4c8e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -125,7 +125,7 @@ class Account < ApplicationRecord
def common_followers_with(other_account)
results = Neography::Rest.new.execute_query('MATCH (a {account_id: {a_id}})-[:follows]->(b)-[:follows]->(c {account_id: {c_id}}) RETURN b.account_id', a_id: id, c_id: other_account.id)
ids = results['data'].map(&:first)
accounts = self.where(id: ids).with_counters.map { |a| [a.id, a] }.to_h
accounts = Account.where(id: ids).with_counters.map { |a| [a.id, a] }.to_h
ids.map { |id| accounts[id] }.compact
rescue Neography::NeographyError, Excon::Error::Socket
[]
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter