Closed gburgett closed 6 years ago
Some additional utility methods on models related to this: https://zube.io/watermarkchurch/development/c/2304 (https://github.com/watermarkchurch/watermarkresources.com/issues/41)
Features:
resolve
resolved?
find
find_by
sys.context
sys.context.backlinks
pry(main)> page = c.main_navigation.items[0].link => #<Page:0x00007ff2366e61f0> pry(main)> page.sys.context.backlinks => [#<MenuButton:0x00007ff22d907de8>, #<Menu:0x00007ff22d3ac218>, #<SiteConfig:0x00007ff23404b388>]
#{field.name}_id
Bug Fixes:
to_h
Documentation:
Services
eq
The dup code should wipe the ID, since it no longer represents that object in Contentful once it's been duplicated.
dup
Some additional utility methods on models related to this: https://zube.io/watermarkchurch/development/c/2304 (https://github.com/watermarkchurch/watermarkresources.com/issues/41)
Features:
resolve
now makes use of the Include param added in #47 in order to resolve to the given depth in the most efficient way possibleresolved?
was added to model objects which checks whether links have been resolved to a given depthfind
orfind_by
and exposes this onsys.context
sys.context.backlinks
which is an array of the parent models from which this model was resolved. Example:#{field.name}_id
, similar to ActiveRecord's representation of foreign key columnsBug Fixes:
to_h
now returns a hash with string keys, so the resulting hash representation is more similar to jsonDocumentation:
Services
singleton.eq
query