Pulling the trigger: How to update counter caches in your Rails app without Active Record callbacks

In this article, we experiment with triggers as a tool for keeping aggregated data consistent when using Active Record and your favorite SQL database. Instead of using sophisticated tools such as ElasticSearch for filtering and searching, we will demonstrate a simple approach that achieves the same result with some out-of-the-box database features. As a bonus, learn how to avoid nasty race conditions!.
Pulling the trigger: How to update counter caches in your Rails app without Active Record callbacks #ruby #rubydeveloper #rubyonrails #active #callbacks #record https://www.rubyonrails.ba/single/pulling-the-trigger-how-to-update-counter-caches-in-your-rails-app-without-active-record-callbacks

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles