Skip to content
Snippets Groups Projects
Commit d930bdab authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

fix learning object import

parent b75ada82
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ class LearningObject < ActiveRecord::Base
validates :id_dspace, presence: true, uniqueness: true, unless: Proc.new { |lo| lo.is_draft? }
searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author, :object_type]
default_scope { includes(:object_type, :attachments, :attachment, :publisher, :topics).order(score: :desc) }
default_scope { includes(:object_type, :attachments, :attachment, :topics).order(score: :desc) }
scope :missing_thumbnail, ->() { where(thumbnail_file_name: nil) }
def search_data
......
......@@ -28,8 +28,8 @@ class Dspace::LearningObjectImporter
end
end
def item_exists? item
LearningObject.exists? id_dspace: item.id
def item_exists?(item)
LearningObject.where(id_dspace: item.id).exists?
end
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