AttrEngine.Schema.BlockTree (attr_engine v0.3.0)

Copy Markdown View Source

Parent-child relationships between blocks — polymorphic.

BlockTree links blocks to parents (pages, other blocks, or any host-app entity). The parent_type + parent_id pair is polymorphic — the host app defines what kinds of parents exist.

Examples

  • CMS: parent_type: "page", parent_id: 42 — block belongs to a page
  • CMS: parent_type: "block", parent_id: 7 — nested block
  • ArtistCircle: parent_type: "gallery", parent_id: 3 — piece in a gallery

Summary

Functions

changeset(tree, attrs)