Plurality.Ash.Changes.Singularize (Plurality v0.2.3)

Copy Markdown View Source

An Ash.Resource.Change that sets an attribute to the singular form of another attribute.

Options

  • :attribute (atom, required) — the attribute to write the singular form to
  • :from (atom, required) — the source attribute to read and singularize

Usage

change {Plurality.Ash.Changes.Singularize, attribute: :resource_name, from: :label}

If the source attribute is nil, the changeset is returned unchanged.