lib/batch_loader/executor_proxy.rb in batch-loader-1.1.1 vs lib/batch_loader/executor_proxy.rb in batch-loader-1.2.0
- old
+ new
@@ -4,13 +4,13 @@
class BatchLoader
class ExecutorProxy
attr_reader :default_value, :block, :global_executor
- def initialize(default_value, &block)
+ def initialize(default_value, key, &block)
@default_value = default_value
@block = block
- @block_hash_key = block.source_location
+ @block_hash_key = "#{key}#{block.source_location}"
@global_executor = BatchLoader::Executor.ensure_current
end
def add(item:)
items_to_load << item