Skip to content
Snippets Groups Projects
Commit ab79e9e4 authored by Lucas Ernesto Kindinger's avatar Lucas Ernesto Kindinger
Browse files

feat(Learning Objects: add 'has_liked' field

parent 08427791
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,28 @@ class LearningObjectSerializer < ActiveModel::Serializer
object.object_type.try(:name)
end
attributes :id, :name, :description, :author, :thumbnail, :publisher, :object_type, :language, :default_attachment_id, :default_location, :default_mime_type, :score, :license, :likes_count, :shares_count, :created_at, :updated_at
def has_liked
object.liked? current_user
end
attributes :id,
:name,
:description,
:author,
:thumbnail,
:publisher,
:object_type,
:language,
:default_attachment_id,
:default_location,
:default_mime_type,
:score,
:license,
:has_liked,
:likes_count,
:shares_count,
:created_at,
:updated_at
has_many :tags
has_many :attachments
......
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