News for hackers. Stuff that matters.
Re:Learning Ruby: Things I Like, Things I Miss from Python by brightball on Tuesday February 16, 2021 @09:34AM (#26154176)
It's got a very helpful transaction block wrapper structure that allows you to do some really interesting things with database transactions.

To be perfectly honest, one of the things that I always love about Rails is exactly how good the database layer is with ActiveRecord. I like using the advanced features of my database, especially PostgreSQL, and I've found that it's really easy to do with Rails.

The "Scopes" feature of active record that let's you save small snippets of a query and chain them together is fantastic. I've used it to create complex filter functions that combine full text search and coordinate distance as simple methods that can be attached to any query.

Being able to add a `.search("fender").distance_from(location, 5, :miles)` onto any query made my life so much easier.

It's been a few years, but I wrote about some of my favorites.

https://www.brightball.com/articles/rails-gems-to-unlock-adv...

There are no comments on this comment yet.