Skip to content
Snippets Groups Projects
Commit 3245f8d8 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Created task to update review rating averages

parent d0e27cfe
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2015 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana
#
# This file is part of portalmec.
#
# portalmec is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# portalmec is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
namespace :review do
desc 'calculate all objects review average'
task update_reviews_average: :environment do
%w(LearningObject Collection).each do |klass|
klass.constantize.all.each do |i|
i.update_columns(review_average: i.review_ratings_average)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment