Method: Origin::Optional#comment

Defined in:
lib/origin/optional.rb

#comment(comment = nil) ⇒ Optional

Note:

Set profilingLevel to 2 and the comment will be logged in the profile collection along with the query.

Associate a comment with the query.

Examples:

Add a comment.

optional.comment('slow query')

Parameters:

  • comment (String) (defaults to: nil)

    The comment to be associated with the query.

Returns:

Since:

  • 2.2.0



283
284
285
286
287
# File 'lib/origin/optional.rb', line 283

def comment(comment = nil)
  clone.tap do |query|
    query.options.store(:comment, comment)
  end
end