Newer
Older
class LearningObject < ActiveRecord::Base
include Reviewable
include Sociable
has_and_belongs_to_many :topics
has_many :collection_items, as: :collectionable
has_many :collections, through: :collection_items
has_many :attachments, class_name: 'LearningObject::Attachment'
belongs_to :publisher, polymorphic: true
searchkick language: 'brazilian', searchable: [:name, :description, :author, :object_type]
def search_data
{
name: name,
description: description,
author: author,
object_type: object_type,
score: score,
published_at: published_at,
# publisher_id: publisher.id,
topics_name: topics.map(&:name)
}
end
def categories
get_metadata_value_of 'dc.subject.category'
end