Created
June 9, 2019 08:22
-
-
Save stevencch99/6e18f54567e291e95ec2e27b4b433de8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
desc 'Reset counter cache of tasks count in project.' | |
task update_tasks: :environment do | |
print '開始更新任務數' | |
Project.all.each do |p| | |
Project.reset_counters(p.id, :tasks) | |
print '.' | |
end | |
puts '更新完成!' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment