Skip to content
Snippets Groups Projects
Commit 874829c4 authored by bfs15's avatar bfs15
Browse files

Fixed download link, added comments

parent 7a5c41da
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,7 @@ class LearningObject < ApplicationRecord
nil
end
# If a LO has more than one object, this gives the location of the main one
def default_attachment_location
object_type.try(:name) == ("Vídeo" || "Áudio") ? default_attachment.try(:retrieve_cache_link) : default_attachment.try(:retrieve_url)
end
......@@ -129,6 +130,11 @@ class LearningObject < ApplicationRecord
default_attachment.retrieve_cache_link
end
# Download link with all relevant objects (currently only one)
def download_link
object_type.try(:name) == ("Vídeo" || "Áudio") ? default_attachment.try(:retrieve_cache_link) : default_attachment.try(:retrieve_url)
end
## score methods
def normalized_collected
max = CollectionItem.where(collectionable_type: 'LearningObject').group(:collectionable_id).order('count_all DESC').count
......
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