Episode
ฝัง
- เผยแพร่เมื่อ 28 พ.ย. 2024
- In this episode, we look at what would seemingly be simple queries, but are more complex once you start looking into them. Using built in ActiveRecord functions, we can make the queries readable and easy to work with. www.driftingru...
► Visit the Merchandise Store - www.railsstore...
► Uptime Monitoring with pingVerse - www.pingverse.com
► Ruby on Rails Templates - www.rubidium.io
► Subscribe to Drifting Ruby at www.driftingru...
You can refactor your command line at the beginning to be rake db:{create,migrate,seed}
Great vid my man
Did you guys just recommend using default scopes? Eager loading something on the default scope is not that bad, but it's so easy to abuse I'd rather avoid it, especially in educational videos.
being explicit is always better with scopes, faster than not you'll find yourself with situation when you want to reverse default_scope, and unscoped ugliness is confusing and bug-prone
I guess I am kinda off topic but do anybody know a good website to stream newly released tv shows online?
I don't think that using default scope is a good idea. If the team is large, in future there is high chances of someone not checking default scope. I prefer using "includes" wherever necessary explicitly.
Great video, thanks Dave!
great! nice tricks, didn't know about merge ;)
Very cool tricks!, I am a subscriber now
Very nice video. Thank you
Thank you great video
What is the difference between includes and join can any one explain?
includes does two things, it eager loads and does an inner join. A join does not eager load.
@@nikitak9628 thank you nikita.
ah what i wouldn't do for that repo to practice on.
The repo is available at www.driftingruby.com/episodes/activerecord-tricks
@@DriftingRuby Amazing! Thank you.
A fcking genius man!