Skip to content

Instantly share code, notes, and snippets.

@eparreno
Created November 10, 2010 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eparreno/670792 to your computer and use it in GitHub Desktop.
Save eparreno/670792 to your computer and use it in GitHub Desktop.
Update counters rake task
task :update_counters => :environment do
Tag.reset_column_information
Tag.all.each do |t|
Tag.update_counters(t.id, :taggings_count => t.taggings.count)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment