eBooru/db/fixes/109_user_status_ticket_count.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

9 lines
275 B
Ruby
Executable File

#!/usr/bin/env ruby
# frozen_string_literal: true
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "config", "environment"))
User.find_each do |user|
UserStatus.for_user(user.id).update_all(ticket_count: Ticket.where(creator_id: user.id).count)
end