Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Why should you avoid calling `where` in ActiveRecord model instance methods?

25,498 Aufrufe • vor 1 Jahr •via X (Twitter)

10 Kommentare

Profilbild von Nate Berkopec
Nate Berkopecvor 1 Jahr

i'll learn how to screencast properly one day, today you're just gonna have to squint

Profilbild von austn.net
austn.netvor 1 Jahr

Oooooh I have a staff engineer who's gonna hate that I know this now

Profilbild von Nolan
Nolanvor 1 Jahr

I have found today’s activity

Profilbild von John Athayde
John Athaydevor 1 Jahr

Awesome. I had not seen that Justin Weiss article, but I’m going to give that a whirl on some persistent N+1 issues I have.

Profilbild von Jeremy Kreutzbender
Jeremy Kreutzbendervor 1 Jahr

The comment I wrote a few days ago speaks for itself. The jira_project method does a funky find_by using data from a json column

Profilbild von daniel T.
daniel T.vor 1 Jahr

can you share the article that you mentioned on the video ? 🙏

Profilbild von Mikkel Malmberg
Mikkel Malmbergvor 1 Jahr

Totally agree. The `where` is a good way to remember to look out for something like this. For the problem at hand, this is probably something you ought to do once at write time and in that case the N+1 wouldn't be (as big) a problem.

Profilbild von Justin Marsh
Justin Marshvor 1 Jahr

Great job. 💪🏼 I would love watch to have more of these!

Profilbild von gato magro
gato magrovor 1 Jahr

Interesting that I'd never seen AR methods used in such way in model instances(instead it was something resembling query builder or scope), but quite lot of times inside facades/presenters

Profilbild von CuriousWBT
CuriousWBTvor 1 Jahr

I really appreciate your straightforward delivery.

Ähnliche Videos