Ash FrameworkAF
Ash Frameworkโ€ข9mo agoโ€ข
10 replies
Ege

Filtering inside a load

Hopefully an easy one. I have a code interface that I'm calling inside a calculation module like this:
defp calculate_least_engaged(organization, after_datetime, before_datetime) do
  descendant_orgs = Organization.get_descendant_organizations!([organization.id], load: [users: [:first_name, :last_name]])
  ...
end

Assuming I pass a
graduation_year
argument to the calculation (and access it as the fourth param on the function), how can I filter the
users
that are being loaded?
Was this page helpful?