Commit 50d27c9d authored by Marllon's avatar Marllon

review avarage update

parent d9738d71
......@@ -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
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment