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
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.