Visoft, Inc. Blogs
  • About
  • Services
  • Products
  • Tech
  • Contact
Sign in Subscribe

activerecord

A collection of 2 posts
Rails Counter Cache Gotcha
ruby

Rails Counter Cache Gotcha

Introduction Today I was attempting to use Rails’ counter cache feature to save on expensive queries. My model’s association is a has_many :through. I ran into issues on my first attempt but eventually came across the answer after beating my head against a wall for quite some time.
01 Mar 2021 2 min read
activerecord

ActiveRecord Queries - Drop the Question Marks

You learn something new everyday! Of course it’s in the documentation, but it’s easy to overlook features. Background As you may or may not know, ActiveRecord lets you specify conditions in a multitude of ways. Take the first example from the docs: class User < ActiveRecord::Base def
30 Jul 2012 2 min read
Page 1 of 1
Visoft, Inc. Blogs © 2025
  • Sign up
  • Facebook
  • X (Twitter)
  • LinkedIn
  • GitHub
Powered by Ghost