Skip to content
Snippets Groups Projects
Commit a7a82a78 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

change required option privacy to optional

parent 698d1afa
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -6,7 +6,7 @@ module Collections
end
def privacy
raise NotImplementedError, 'This method must be implemented'
nil
end
end
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment