Module: ActiveGraph::Node::Query::QueryProxyFindInBatches

Included in:
QueryProxy
Defined in:
lib/active_graph/node/query/query_proxy_find_in_batches.rb

Instance Method Summary collapse

Instance Method Details

#find_each(options = {}) ⇒ Object



11
12
13
14
15
# File 'lib/active_graph/node/query/query_proxy_find_in_batches.rb', line 11

def find_each(options = {})
  query.return(identity).find_each(identity, @model.primary_key, options) do |result|
    yield result[identity]
  end
end

#find_in_batches(options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/active_graph/node/query/query_proxy_find_in_batches.rb', line 5

def find_in_batches(options = {})
  query.return(identity).find_in_batches(identity, @model.primary_key, options) do |batch|
    yield batch.map { |record| record[identity] }
  end
end