instance method with

Ruby on Rails edge

Since edge

Signature

with(...)

Add a Common Table Expression (CTE) that you can then reference within another SELECT statement.

See ActiveRecord::QueryMethods#with for more information.

When given a block, and the Object#with core extension is loaded, this delegates to it instead, temporarily setting the given attributes on the class for the duration of the block and restoring them afterwards.

Parameters

... req
Source
# File activerecord/lib/active_record/querying.rb, line 33
    def with(...)
      return super if block_given? && defined?(super)
      all.with(...)
    end

Defined in activerecord/lib/active_record/querying.rb line 33 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Querying

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close