diff --git a/app/models/user.rb b/app/models/user.rb index 8d183743fcd9df34be35424c6db0668ca4a57a5f..7086b8c11a49d842f41ef12f77427cc806c50ed5 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 1ca088d6817f248d7cc0f7575f1c47ee0e028d52..5d0574787d7f1d7f82466186712ee500cc3c12d1 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