MishkaCmsCore.Accounts.Calculations.ByMaster (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Whether the account a record names is a master's, for every record in one read.

:field names the attribute holding the user id:

calculate :author_master?, :boolean,
          {MishkaCmsCore.Accounts.Calculations.ByMaster, field: :author_id}

Load it beside the account relationship and pass both to MishkaCmsCore.Accounts.Helper.who/4. A record with no id in :field is false.

Summary

Functions

describe(opts)

Callback implementation for Ash.Resource.Calculation.describe/1.

has_calculate?()

has_expression?()

Callback implementation for Ash.Resource.Calculation.has_expression?/0.

strict_loads?()

Callback implementation for Ash.Resource.Calculation.strict_loads?/0.