AttrEngine.Schema.AttributeSetData (attr_engine v0.2.2)

Copy Markdown View Source

Content instance — the actual JSONB data for an AttributeSet.

ASD holds the values that fill the shape defined by an AttributeSet. Each ASD is a row of content: a CMS block's data, an artist's piece, an entity's custom attributes.

Data shape

The data field is a JSONB map keyed by attribute handles:

%{
  "title" => %{"en" => "Welcome", "el" => "Καλωσήρθατε"},
  "image" => %{"url" => "/assets/abc123", "alt" => "..."},
  "featured" => true
}

Localized fields nest by locale key. Non-localized fields are flat values.

Config cascade — Layer 3

ui_config on ASD provides per-instance presentation overrides:

%{
  "title" => %{"classes" => "text-center", "append" => true}
}

These are applied on top of the ASA's ui_config.

Ownership

owner_id and owner_type support multi-tenant ownership — "who created this". The host app decides what these reference (user, account, artist, etc.).

Summary

Functions

Standard changeset — requires data and attribute_set_id.

Functions

changeset(asd, attrs)

Standard changeset — requires data and attribute_set_id.