Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
874829c4
Commit
874829c4
authored
7 years ago
by
bfs15
Browse files
Options
Downloads
Patches
Plain Diff
Fixed download link, added comments
parent
7a5c41da
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/learning_object.rb
+6
-0
6 additions, 0 deletions
app/models/learning_object.rb
with
6 additions
and
0 deletions
app/models/learning_object.rb
+
6
−
0
View file @
874829c4
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment