watermarkchurch / wcc-contentful

An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.
MIT License
2 stars 1 forks source link

Strip nils out of array links #212

Closed gburgett closed 4 years ago

gburgett commented 4 years ago

Currently, in the page sections array, if a content editor unpublishes a section and it's still linked to by the page, then the sections array will include a nil:

> Page.sections
[<SectionBlockText>, <SectionBlockText>, nil]
> Page.sections.length
3

Proposal: At the model layer, strip out nils in linked arrays.

> Page.sections
[<SectionBlockText>, <SectionBlockText>]
> Page.sections.length
2