正在加载视频...

视频加载失败

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

25,498 次观看 • 1 年前 •via X (Twitter)

10 条评论

Nate Berkopec 的头像
Nate Berkopec1 年前

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

austn.net 的头像
austn.net1 年前

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

Nolan 的头像
Nolan1 年前

I have found today’s activity

John Athayde 的头像
John Athayde1 年前

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.

Jeremy Kreutzbender 的头像
Jeremy Kreutzbender1 年前

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

daniel T. 的头像
daniel T.1 年前

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

Mikkel Malmberg 的头像
Mikkel Malmberg1 年前

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.

Justin Marsh 的头像
Justin Marsh1 年前

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

gato magro 的头像
gato magro1 年前

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

CuriousWBT 的头像
CuriousWBT1 年前

I really appreciate your straightforward delivery.

相关视频