method

annotate

Importance_1
v6.1.3.1 - Show latest stable - 0 notes - Class: ActiveRecord::QueryMethods
annotate(*args) public

Adds an SQL comment to queries generated from this relation. For example:

User.annotate("selecting user names").select(:name)
# SELECT "users"."name" FROM "users" /* selecting user names */

User.annotate("selecting", "user", "names").select(:name)
# SELECT "users"."name" FROM "users" /* selecting */ /* user */ /* names */

The SQL block comment delimiters, “/*” and “*/”, will be added automatically.

Show source
Register or log in to add new notes.