Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
50d27c9d
Project 'rfhf19/cleanning-portalmec' was moved to 'rfhferreira/cleanning-portalmec'. Please update any links and bookmarks that may still have the old path.
Commit
50d27c9d
authored
5 years ago
by
Marllon
Browse files
Options
Download
Email Patches
Plain Diff
review avarage update
parent
d9738d71
develop
issue/54-curator-queue
issue/58-testar-s3
issue/65-govbr
master
pre-submission
pre-languages
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/review.rb
+5
-1
app/models/review.rb
app/serializers/learning_object_serializer.rb
+1
-1
app/serializers/learning_object_serializer.rb
with
6 additions
and
2 deletions
+6
-2
app/models/review.rb
+
5
-
1
View file @
50d27c9d
...
...
@@ -89,7 +89,11 @@ class Review < ApplicationRecord
private
def
calculate_review_rate
ReviewAverageCalculatorWorker
.
perform_in
(
1
.
minutes
,
reviewable
.
id
,
reviewable
.
class
.
name
)
if
!
reviewable
.
nil?
reviewable
.
review_average
=
reviewable
.
review_ratings_average
reviewable
.
save
end
# ReviewAverageCalculatorWorker.perform_in(1.minutes, reviewable.id, reviewable.class.name)
end
end
This diff is collapsed.
Click to expand it.
app/serializers/learning_object_serializer.rb
+
1
-
1
View file @
50d27c9d
...
...
@@ -18,7 +18,7 @@
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
class
LearningObjectSerializer
<
ActiveModel
::
Serializer
cache
key:
'learning_object'
,
expires_in:
4
.
hours
,
except:
[
:likes_count
,
:liked
,
:reviewed
,
:complained
,
:views_count
,
:downloads_count
]
cache
key:
'learning_object'
,
expires_in:
4
.
hours
,
except:
[
:likes_count
,
:liked
,
:reviewed
,
:complained
,
:views_count
,
:downloads_count
,
:review_average
]
def
default_mime_type
object
.
default_attachment
.
try
(
:mime_type
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help