RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in