I was working with a readonly model in Rails the other day and ran into an issue whilst testing it. Here's what I ran into and the solution I came up with. Readonly models are a great way to signal that, well, you should only ever read them, not write them. Maybe you have some external system that connects to…
#ruby-on-rails
8 posts
17 Mar
20 Nov 2025
N+1 queries are one of the most common performance killers in Rails apps, but also one of the easiest to fix. In this post, we'll see how a single line of code can reduce 1,101 database queries down to 3. N+1s occur in rails when you have associated ActiveRecord models, and iterate over one model while accessing fields on the…
1 Mar 2023
By: Kyler Stole TrueCar’s Model Search offers a search results page (SRP) for virtual vehicle models. Combinable filters help you narrow down your vehicle needs to specific models that have what you want. This page was actually preceded by Vehicle Rankings pages, which also filter down models but then rank the results using TrueCar’s proprietary scoring system. When we ported…
14 Feb 2023
By: Kyler Stole Are you a car shopper but don’t know which car fits your needs? TrueCar’s Model Search can help narrow it down. It consists of a search results page (SRP) of vehicle models along with a slew of combinable filters. But what powers such a thing?? Well, Elasticsearch, because relational databases struggle with the aggregations to display counts…
7 Feb 2023
By: Kyler Stole If you ever struggle to express a query in ActiveRecord, you may be able to build it with Arel instead. Arel is the platform that manages the abstract syntax tree (AST) used to build SQL queries in Rails. It’s the implementation underneath the veneer of ActiveRecord (AR) and it’s considerably more flexible than just the functionality that…
15 Sept 2016
Microservices have been a popular topic recently. People argue over whether you should start with microservices or evolve there from a single ‘monolithic’ app . Maybe in a well designed app microservices are simply a deployment option ? It all seems rather academic when you have upward of 100,000 lines of (non-test) Ruby code glowering back at you. (And that’s…
27 Feb 2015
Hello!!! Every project you have to make some requests using Ajax, right? I know that jQuery has done a very good job and almost all project you start it is present there, together with your Javascript files. So you can make Ajax calls any time, where you want, just making the call using Javascript. I … Continue reading Using Ruby…
8 Jun 2012
Hello people! I am now finishing my Post-graduate course in Web Development at PUCMG and I had the RubyOnRails discipline to do. The final work was develop a simple Social Network app using RubyOnRails. I love that framework and think the Ruby language is amazing. So, the final result is shared in GitHub at https://github.com/juniorgrossi/social_network_dsw7 … Continue reading MySocial –…