DEV: Respect plugin enabled state when serializing (#77)

This commit is contained in:
David Taylor 2023-04-24 15:08:02 +01:00 committed by GitHub
parent 3af2747ed1
commit 25c412d1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ after_initialize do
(SiteSetting.user_notes_moderators_delete? && user.staff?) || user.admin?
end
add_to_serializer(:admin_detailed_user, :user_notes_count, false) do
add_to_serializer(:admin_detailed_user, :user_notes_count) do
object.custom_fields && object.custom_fields["user_notes_count"].to_i
end