lib/ledger_sync/domains/serializer/relation.rb in ledger_sync-domains-1.0.3 vs lib/ledger_sync/domains/serializer/relation.rb in ledger_sync-domains-1.0.4
- old
+ new
@@ -98,9 +98,10 @@
end
class SerializerReferencesOneType
def proxy(serializer:, resource:, attribute:)
item = resource.try(attribute)
+ return nil unless item
serializer.serialize(resource: item)
end
end