Created
December 29, 2016 17:10
-
-
Save brnrdog/27a67e165bbf4ba2bf3ad654a255c8b7 to your computer and use it in GitHub Desktop.
brtr-category-task
This file contains hidden or 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 :category do | |
task :count_services do | |
Category.all.each do |category| | |
category.update(services_count: category.services.count) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment