Permalink
Browse files

Yield self to batch block

  • Loading branch information...
1 parent 58cffb0 commit c9d179204a33fc7d9dd13c3c060bb55ee9707755 Robert Zotter committed with b Aug 18, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/cassandra/cassandra.rb
@@ -231,16 +231,16 @@ def count_range(column_family, options = {})
get_range(column_family, options).select{|r| r.columns.length > 0}.compact.length
end
- # Open a batch operation and yield. Inserts and deletes will be queued until
- # the block closes, and then sent atomically to the server. Supports the
- # <tt>:consistency</tt> option, which overrides the consistency set in
+ # Open a batch operation and yield self. Inserts and deletes will be queued
+ # until the block closes, and then sent atomically to the server. Supports
+ # the <tt>:consistency</tt> option, which overrides the consistency set in
# the individual commands.
def batch(options = {})
_, _, _, options =
extract_and_validate_params(schema.keys.first, "", [options], WRITE_DEFAULTS)
@batch = []
- yield
+ yield(self)
compact_mutations!
@batch.each do |mutation|

0 comments on commit c9d1792

Please sign in to comment.