zachdaniel
Creator of Ash
Support for to-one relationship paths in calculations has been merged
Hey friends! A long time quality of life feature we’ve been wanting to add is the ability to refer to to-one relationships in calculations. Since an example is worth a thousand words, lets see how you would have had to refer to to-one related information in a calculation before:
The old way
Using a named aggregate
aggregates do
# add a `first` aggregate
first :authors_first_name, :authors, :first_name
end
calculations do
# refer to that in a calculation
calculate :some_calculation, :string, expr(authors_first_name ...)
end
Using in-line aggregates
# use an in-line first aggregate
calculate :some_calculation, :string, expr(first(author, field: :first_name))
The new way
The old ways will continue to work, but you can now use to-one path relationships directly in your calculations. You can’t use to-many relationships in a calculation, i.e posts.text in a calculation, because which post are you referring to?
calculate :some_calculation, :string, expr(author.first_name ...)
Hopefully this will make writing certain kinds of calculations much simpler ![]()
Popular in News & Updates
InstructorLite - v1.1.1 and v1.1.2
Pass Gemini token in request header rather than in request parameter (as is shown in API reference :...
New
We recently released Nerves 1.4.0 and an update to the Nerves new project generator, nerves_bootstrap. The biggest change is support for ...
New
New versions of the Kiosk systems are out. These systems update official Nerves systems with a local web browser for rendering user inter...
New
We recently released Nerves 1.6 and corresponding updates to the Nerves new project generator, nerves_bootstrap and our official systems....
New
Hey folks, made some recent performance improvements to spark, the tool underlying all of our DSLs. GitHub - ash-project/spark: Tooling f...
New
I know you might be thinking ¬
“Why make another SSH daemon wrapper when there already exists many like sshex and esshd??”
Well, grea...
New
I wanted to let everyone know that the Erlang Ecosystem Foundation (EEF) has a working group dedicated to embedded systems and IoT. We ha...
New
NervesPack 0.4.0 is a minor bump with a fairly big change.
This update drops :nerves_firmware_ssh in favor of the newer and more focused...
New
We’re excited to announce that we’re actively working on NervesHub 2.0, an improved version of our IoT device firmware update and managem...
New
The new Ash Framework site and installer are live. Please try it out and let me know what you think!
New
Other popular topics
Update:
How to use the Blogs & Podcasts section
You can post links to your blog posts or podcasts either in one of the Official Blog...
New
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!)
This post collects co...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
by Lance Halvorsen
Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
New
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New







