about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authornicolas <nclm@users.noreply.github.com>2016-11-25 08:53:34 +0100
committerGitHub <noreply@github.com>2016-11-25 08:53:34 +0100
commit9af6c52a41664e5b6dd7c200d696499e00cf1c01 (patch)
treee56114e766ee39c4825a556c0dc12e90240faece /app/models/account.rb
parent60577f4c6ee9f4a4c9af0a41a8954e19a5f2c8cf (diff)
parent543d06971e461510591ff64ebc666bd414e8e084 (diff)
Merge pull request #3 from Gargron/master
Merge
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb9
1 files changed, 0 insertions, 9 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 16d654195..a60a23e14 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -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)