Re:Elixir web development 101: collaborative todolist with r...
by pmontra on Friday October 27, 2017 @12:22PM
(#15569845)
It is more flexible, but often that flexibility is not necessary. I replied in more detail to the sibling answer but in the Ecto version of this sample query, don't I have to write the definition of actual and by_email? AR gives me by_email for free. Instead, actual would be a scope and I have to write that code with AR too.
[ Parent
| on HN ]
Re:Elixir web development 101: collaborative todolist with r...
by out_of_protocol on Friday October 27, 2017 @12:43PM
(#15570019)
Exactly the same:
Repo.get_by(Post, title: "My post")
https://hexdocs.pm/ecto/Ecto.Repo.html#c:get_by/3(Rails/AR deprecated find_by_xxx methods, promotes find_by() instead - for performance reasons)