We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class Article schema articles do type tags : Array(Tag), through: TagRelation, foreign_key: "article_id" end end class Tag schema tags do type value : String type articles : Array(Article), through: TagRelation, foreign_key: "tag_id" end end class TagRelation schema tag_relations do type tag : Tag, key: "tag_id" type article : Article, key: "article_id" end end sql = <<-SQL SELECT articles.*, tags.value FROM articles JOIN tag_relations ON tag_relations.article_id = articles.id JOIN tags ON tags.id = tag_relations.tag_id WHERE id = ? SQL Article.join(tags: true) { |x| x.select(:value) }.where(id: 42).build == {sql, [42]}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: