PERF: Allow user serializer to make use of preloaded custom fields (#9074)

This commit is contained in:
David Taylor
2020-03-03 13:56:54 +00:00
committed by GitHub
parent 0df72a51b8
commit d23f7af3cb
3 changed files with 29 additions and 6 deletions

View File

@@ -142,6 +142,10 @@ module HasCustomFields
super
end
def custom_fields_preloaded?
!!@preloaded_custom_fields
end
def custom_field_preloaded?(name)
@preloaded_custom_fields && @preloaded_custom_fields.key?(name)
end