From 698d1afac5c14f87235d075c96f3ae28d11410a1 Mon Sep 17 00:00:00 2001
From: Mauricio Giacomini Girardello <mauriciogiacomini4@gmail.com>
Date: Tue, 3 Nov 2015 09:48:27 -0200
Subject: [PATCH] change method args for collection_repository.all in User
 model

---
 app/models/user.rb                                  | 2 +-
 app/repositories/orient_db/collection_repository.rb | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/models/user.rb b/app/models/user.rb
index 8d183743..7086b8c1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -35,7 +35,7 @@ class User < ActiveRecord::Base
   validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\Z/
 
   def collections
-    collection_repository.all self
+    collection_repository.all Collections::UserPrivateContext.new(self)
   end
 
   def bookmarks
diff --git a/app/repositories/orient_db/collection_repository.rb b/app/repositories/orient_db/collection_repository.rb
index 1ca088d6..5d057478 100644
--- a/app/repositories/orient_db/collection_repository.rb
+++ b/app/repositories/orient_db/collection_repository.rb
@@ -48,7 +48,6 @@ module OrientDb
     ##
     # Select all collections in context
     def all(context = Collections::PublicContext.new)
-      #query = sprintf("select * from (select expand(in('BelongsTo')) from %s) where name<>'Bookmarks' and privacy = '%s'", user.rid)
       query = sprintf("select * from %s where name<>'Bookmarks' and privacy = '%s'", context.from, context.privacy)
       build_objects connection.query(query)
     end
-- 
GitLab