
Rails Denormalized Cache Column vs COUNT Query Mismatch: When Seed Data Creates 0%
I inserted demo seed data directly into a Rails app, and all percentages showed as 0% on the screen. Server logs were clean, the data was clearly in the DB, yet the numbers would not appear. Situation This was a Rails app with a voting feature. There is a screen showing vote counts per choice, calculating percentages against total votes and displaying them with progress bars and numbers. I needed to show a demo, so I fetched real-time data from an external API and inserted it as seed data. The approach was simple: ...
