Skip to content

Commit

Permalink
RightAws: SdbInterface: put_attributes fix (zero length attributes we…
Browse files Browse the repository at this point in the history
…re not saved)
  • Loading branch information
Konstantin committed Mar 31, 2010
1 parent 8d7a660 commit 2f8fa3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sdb/right_sdb_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def pack_attributes(attributes, replace = false) #:nodoc:
result["Attribute.#{idx}.Replace"] = 'true' if replace
# pack Name/Value
unless values.nil?
Array(values).each do |value|
# Array(values) does not work here:
# - Array('') => [] but we wanna get here ['']
[values].flatten.each do |value|
result["Attribute.#{idx}.Name"] = attribute
result["Attribute.#{idx}.Value"] = ruby_to_sdb(value) unless skip_values
idx += 1
Expand Down

0 comments on commit 2f8fa3b

Please sign in to comment.