sezaru
I’m upgrading one of my projects from Ash 2.0 to 3.0 and one of the things that changed was this:
resource.actions.read.filter can now be specified multiple times. Multiple filters will be combined with and .
I do like this change, but it seems that this is only available for read actions, if I try to do the same with my aggregates I will get the following error:
Multiple values for key `:filter`
Of course, the documentation explicitly says that is only for read.filter but I think this ends up creating more confusion since now we have the filter keyword with different behaviors depending where it is used.
Is there some technical issue that an aggregation (and other places that use filter) can’t have the same behavior as a read.filter and allow being specified multiple time like this?
count :total_students_this_month, :students do
filter expr(inserted_at >= fragment("date_trunc('month', now())"))
filter expr(inserted_at < fragment("date_trunc('month', now()) + interval '1 month'"))
end
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
Be sure to also update
sparkto its latest version, let me know if the issue persists after that.sezaru
By latest version you mean from github main repo or the latest version in hex? If the later, I’m already using it (version 2.2.4)
zachdaniel
I just meant latest version in hex
Ah, sorry, reading more closely:
filtercannot currently be stated twice in aggregates, only in actions. Please open a feature request for this onash.sezaru
Here it is: Support multiple filters in aggregations · Issue #1265 · ash-project/ash · GitHub