When Does an Active Record Query Actually Run?
An ActiveRecord::Relation is deferred query intent, not loaded data. This article traces when Rails query methods build relations, when methods like present?, count, size, length, and exists? execute SQL, and how to debug the line that turns query intent into database work.
URL: https://railsrevelry.substack.com/p/when-does-an-active-record-query-actually-run?r=4jsb
Post a comment