0
0
Fork 0

Remove Neo4J

This commit is contained in:
Eugen Rochko 2016-11-24 23:46:27 +01:00
parent fca183968e
commit 8efa081f21
23 changed files with 6 additions and 323 deletions

View file

@ -130,15 +130,6 @@ class Account < ApplicationRecord
username
end
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 = Account.where(id: ids).with_counters.limit(20).map { |a| [a.id, a] }.to_h
ids.map { |id| accounts[id] }.compact
rescue Neography::NeographyError, Excon::Error::Socket
[]
end
class << self
def find_local!(username)
find_remote!(username, nil)