Changed LearningObject index to show only published LOs

parent 9e5991d0
......@@ -40,7 +40,8 @@ class V1::LearningObjectsController < ApplicationController
def index
learning_objects = policy_scope(LearningObject).includes(:tags, :publisher, :language, :license, :subjects, :educational_stages, :reviews)
# learning_objects = policy_scope(LearningObject).includes(:tags, :publisher, :language, :license, :subjects, :educational_stages, :reviews)
learning_objects = LearningObject.published.includes(:tags, :publisher, :language, :license, :subjects, :educational_stages, :reviews)
learning_objects = learning_objects.order(score: :desc) if params[:sort].blank?
learning_objects = paginate learning_objects
serializer = params[:obaa].nil? ? LearningObjectSerializer : LearningObjectObaaSerializer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment