lib/ledger_sync/domains/serializer/relation.rb in ledger_sync-domains-1.0.4 vs lib/ledger_sync/domains/serializer/relation.rb in ledger_sync-domains-1.0.5
- old
+ new
@@ -39,9 +39,10 @@
end
READER_METHODS.each do |name|
define_method(name) do |*args, **params, &block|
item = @query.send(name, *args, **params, &block)
+ return nil unless item
@serializer.serialize(resource: item)
end
end