blob: f36cc391545149fd066160d58d2fdfe82aa96a90 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
namespace :monsterfork do
desc '(Re-)Index statuses for search.'
task index_statuses: :environment do
include TextHelper
i = 0
total = Status.count
Status.find_in_batches do |statuses|
ActiveRecord::Base.logger.info("Indexing status #{1+i} of #{total}.")
ActiveRecord::Base.logger.silence do
i += statuses.count
statuses.each do |s|
s.update_column(:normalized_text, normalize_status(s))
end
end
end
end
end
|