mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Fix quotes counting (#35917)
This commit is contained in:
parent
3c9bde31f7
commit
6ad0ddebe4
|
@ -90,13 +90,13 @@ class Quote < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def increment_counter_caches!
|
def increment_counter_caches!
|
||||||
return unless acceptable?
|
return unless accepted?
|
||||||
|
|
||||||
quoted_status&.increment_count!(:quotes_count)
|
quoted_status&.increment_count!(:quotes_count)
|
||||||
end
|
end
|
||||||
|
|
||||||
def decrement_counter_caches!
|
def decrement_counter_caches!
|
||||||
return unless acceptable?
|
return unless accepted?
|
||||||
|
|
||||||
quoted_status&.decrement_count!(:quotes_count)
|
quoted_status&.decrement_count!(:quotes_count)
|
||||||
end
|
end
|
||||||
|
@ -104,7 +104,7 @@ class Quote < ApplicationRecord
|
||||||
def update_counter_caches!
|
def update_counter_caches!
|
||||||
return if legacy? || !state_previously_changed?
|
return if legacy? || !state_previously_changed?
|
||||||
|
|
||||||
if acceptable?
|
if accepted?
|
||||||
quoted_status&.increment_count!(:quotes_count)
|
quoted_status&.increment_count!(:quotes_count)
|
||||||
else
|
else
|
||||||
# TODO: are there cases where this would not be correct?
|
# TODO: are there cases where this would not be correct?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user