Let\'s say I have two models, Post and Comment and the comment model can be 1 out of 2 types, normal and fancy which is defin
Post
Comment
normal
fancy
Conditional associations are now available in Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#has_many/3-filtering-associations
Ecto
defmodule Post do use Ecto.Schema schema "posts" do has_many :public_comments, Comment, where: [public: true] end end