Ash FrameworkAF
Ash Framework7mo ago
9 replies
Steve

Using config values in filter expressions

I have a fairly simple read action, like so:

    read :get_by_id do
      get? true

      argument :id, :uuid, allow_nil?: false

      filter expr(expires_at > now())
      filter expr(attempts < 3)
    end


The max attempts is set in the config and I would like to use that rather than a hardcoded count. I couldn't figure out a way to get it in there nicely as-is. Is the best way to do it using a prepare function?
Was this page helpful?