gab-social/lib/tasks/fix_group_member_counts.rake
2019-07-22 03:46:00 +03:00

13 lines
336 B
Ruby

# frozen_string_literal: true
task fix_group_member_counts: 'gabsocial:fix-group-member-counts'
namespace :gabsocial do
desc 'Re-compute group member counts'
task :fix_group_member_counts => :environment do
Group.select(:id).all.each do |group|
group.update_column(:member_count, group.accounts.count)
end
end
end