Method: ActiveGraph::Node::Query::QueryProxy#branch
- Defined in:
- lib/active_graph/node/query/query_proxy.rb
#branch { ... } ⇒ QueryProxy
Executes the relation chain specified in the block, while keeping the current scope
204 205 206 207 208 209 210 211 212 |
# File 'lib/active_graph/node/query/query_proxy.rb', line 204 def branch(&block) fail LocalJumpError, 'no block given' if block.nil? # `as(identity)` is here to make sure we get the right variable # There might be a deeper problem of the variable changing when we # traverse an association as(identity).instance_eval(&block).query.proxy_as(self.model, identity).tap do |new_query_proxy| propagate_context(new_query_proxy) end end |