diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb index 71d487f35c0d7ddfb404795f40f3972fb25578bf..88ec4719345dbf51af85ed37912f84b66342b5e9 100644 --- a/app/controllers/collections_controller.rb +++ b/app/controllers/collections_controller.rb @@ -1,6 +1,6 @@ class CollectionsController < ApplicationController before_action :set_collection, only: [:show, :update, :destroy, :like, :add_learning_object] - before_action :authenticate_user!, only: [:show, :update, :destroy, :like, :add_learning_object] + before_action :authenticate_user!, only: [:update, :destroy, :like, :add_learning_object] # GET /collections # GET /collections.json diff --git a/app/models/collections/context.rb b/app/models/collections/context.rb index 5413ff640a5adc65330c5e8afee754c43cd5dd64..b2a971487086393f6f43b4b4924625dd5698b9bd 100644 --- a/app/models/collections/context.rb +++ b/app/models/collections/context.rb @@ -6,7 +6,7 @@ module Collections end def privacy - raise NotImplementedError, 'This method must be implemented' + nil end end diff --git a/app/repositories/orient_db/collection_repository.rb b/app/repositories/orient_db/collection_repository.rb index 5d0574787d7f1d7f82466186712ee500cc3c12d1..9a2eb5a90104321651b6f5da5c8a990ebdd9a382 100644 --- a/app/repositories/orient_db/collection_repository.rb +++ b/app/repositories/orient_db/collection_repository.rb @@ -48,7 +48,8 @@ module OrientDb ## # Select all collections in context def all(context = Collections::PublicContext.new) - query = sprintf("select * from %s where name<>'Bookmarks' and privacy = '%s'", context.from, context.privacy) + query = sprintf("select * from %s where name<>'Bookmarks'", context.from) + query += sprintf("and privacy = '%s'", context.privacy) unless context.privacy.blank? build_objects connection.query(query) end