0
0
Fork 0

Fix count numbers from ActivityPub not being saved (#4899)

They are marked as read-only by Rails, but we know what we are doing,
so we are un-marking them as such.

The mastodon:maintenance:update_counter_caches task is not really
supposed to be run anymore (it was a one-time thing during an upgrade)
however, just in case, I have modified it to not touch ActivityPub
accounts.

Also, no point writing to logger from these rake tasks, since they
are not to be run from cron. Better to give stdout feedback.
This commit is contained in:
Eugen Rochko 2017-09-12 00:16:03 +02:00 committed by GitHub
parent 0ef9d45d05
commit 0a6b098668
2 changed files with 12 additions and 8 deletions

View file

@ -172,6 +172,10 @@ class Account < ApplicationRecord
end
class << self
def readonly_attributes
super - %w(statuses_count following_count followers_count)
end
def domains
reorder(nil).pluck('distinct accounts.domain')
end