eBooru/db/fixes/104_2_add_elasticsearch_replacement_data.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

10 lines
306 B
Ruby
Executable File

#!/usr/bin/env ruby
# frozen_string_literal: true
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
Post.find_each do |post|
puts post.id
post.document_store.client.update_document_attributes has_pending_replacements: post.replacements.pending.any?
end