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
Harbor 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
50d27c9d
You need to sign in or sign up before continuing.
Commit
50d27c9d
authored
6 years ago
by
Marllon
Browse files
Options
Downloads
Patches
Plain Diff
review avarage update
parent
d9738d71
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/review.rb
+5
-1
5 additions, 1 deletion
app/models/review.rb
app/serializers/learning_object_serializer.rb
+1
-1
1 addition, 1 deletion
app/serializers/learning_object_serializer.rb
with
6 additions
and
2 deletions
app/models/review.rb
+
5
−
1
View file @
50d27c9d
...
@@ -89,7 +89,11 @@ class Review < ApplicationRecord
...
@@ -89,7 +89,11 @@ class Review < ApplicationRecord
private
private
def
calculate_review_rate
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
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 @@
...
@@ -18,7 +18,7 @@
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
class
LearningObjectSerializer
<
ActiveModel
::
Serializer
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
def
default_mime_type
object
.
default_attachment
.
try
(
:mime_type
)
object
.
default_attachment
.
try
(
:mime_type
)
...
...
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