Skip to content
Snippets Groups Projects
Commit 0f710bbd authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

change find to where in user likes

parent 1994e262
No related branches found
No related tags found
No related merge requests found
......@@ -50,15 +50,13 @@ module PublisherController
def show_liked_learning_objects
includes = [:taggings, :tags, :subject_relations, :subjects, :stage_relations, :educational_stages, :publisher, :language, :license]
learning_objects = paginate LearningObject.includes(includes).find(
Like.where(user: @publisher, likeable_type: 'LearningObject').pluck(:likeable_id)
learning_objects = paginate LearningObject.includes(includes).where(id: Like.where(user: @publisher, likeable_type: 'LearningObject').pluck(:likeable_id)
)
render json: learning_objects
end
def show_liked_collections
collections = paginate Collection.find(
Like.where(user: @publisher, likeable_type: 'Collection').pluck(:likeable_id)
collections = paginate Collection.where( id: Like.where(user: @publisher, likeable_type: 'Collection').pluck(:likeable_id)
)
render json: collections
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