Skip to content
Snippets Groups Projects
Commit 171e7bc9 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'collections-thumbnail' into 'master'

Collections thumbnail

See merge request !365
parents 9fb087fb dc568b3d
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,12 @@ class V1::LearningObjectsController < ApplicationController
# Use callbacks to share common setup or constraints between actions.
def set_learning_object
@learning_object ||= LearningObject.unscoped.find(params[:id])
#check if user is admin to show destroyed object
if current_user.try(:is_admin?)
@learning_object ||= LearningObject.unscoped.find(params[:id])
else
@learning_object ||= LearningObject.find(params[:id])
end
end
def set_new_learning_object
......
......@@ -16,7 +16,7 @@ class CollectionSerializer < ActiveModel::Serializer
def items_thumbnails
thumbs = []
i = 0
while thumbs.size < 4 && i < object.collection_items.size do
while thumbs.size < 6 && i < object.collection_items.size do
t = object.collection_items[i].thumbnail
thumbs << t unless t.blank?
i=i+1
......
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