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 by Marllon's avatar Marllon
Browse files

review avarage update

Showing with 6 additions and 2 deletions
+6 -2
......@@ -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