Comment

Comment by buffington

With all due respect, Cal Paterson doesn't seem to know what he's talking about.

The Ruby example he uses as the "The Troublesome Active Record Pattern" simply bizarre. You'd have to deliberately avoid reading the documentation for ActiveRecord to produce that code.

In other words, if you write terrible code, you'll get terrible results.

In actual fact, when you read the docs and actually use ActiveRecord as it was intended you can do exactly what he says it doesn't. Here's what that looks like:

  Book.joins(:author).where(authors: {nationality: "Italian", state: "deceased"})
That produces a SQL query that's nearly verbatim what he claims ActiveRecord can't do.
parent buffington 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton