Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PortalMEC
portalmec
Commits
50d27c9d
Commit
50d27c9d
authored
Feb 28, 2019
by
Marllon
Browse files
review avarage update
parent
d9738d71
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
app/models/review.rb
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
app/serializers/learning_object_serializer.rb
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
)
...
...
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