Skip to content

Commit

Permalink
Fix extraction Hash with keys in observe_and_wait
Browse files Browse the repository at this point in the history
Change-Id: I21bce1e9d1ce161b09b18e4c759c34a60563cabb
Reviewed-on: http://review.couchbase.org/18956
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Chris Anderson <jchris@couchbase.com>
  • Loading branch information
avsej authored and Chris Anderson committed Jul 27, 2012
1 parent b424398 commit 912dd23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/couchbase/bucket.rb
Expand Up @@ -221,13 +221,13 @@ def observe_and_wait(*keys, &block)
if keys.size == 0
raise ArgumentError, "at least one key is required"
end
if keys.size != 1 || !keys[0].is_a?(Hash)
if keys.size == 1 && keys[0].is_a?(Hash)
key_cas = keys[0]
else
key_cas = keys.flatten.reduce({}) do |h, kk|
h[kk] = nil # set CAS to nil
h
end
else
key_cas = keys
end
if async?
do_observe_and_wait(key_cas, options, &block)
Expand Down

0 comments on commit 912dd23

Please sign in to comment.