Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix marshal load of array for drafted/deleted child entries
The current behaviour for deleted/drafted entries it's different for retrieved and unserialized arrays. Let's suppose I have a model with some reference array field. And let's suppose I have a published entry with some unpublished entries on that referenced on that field. This is the current behaviour for requested arrays: ```ruby entries = client.entries(some_query) # => <Contentful::Array total=1 skip=0 limit=100> entries.first.raw['fields']['children'] # => [{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"6ZEkh78aryxwWinQhB2MNq"}}] entries.first.children # => [] ``` That is the right and expected behaviour, ignoring drafted entries. However, if we do the same after serializing and unserializing the array: ```ruby Marshal.load(Marshal.dump(entries)).first.children # => [<Contentful::Link id='6ZEkh78aryxwWinQhB2MNq'>] ``` This fix should solve that issue by sending the errors to the ResourceBuilder
- Loading branch information