Tapjoy/right_aws — pull request #1 by akasper (2012-04-05 04:06:42+00:00)
Title: Fix for 'replace' param in modified method signature

Handle the case where some attributes are to be replaced and other are to be appended. Relevant spec can be found in tapjoyserver's spec/lib/simpledb_resource_spec.rb:70 :

it 'handles adding and replacing attrs in one save operation' do
attrs = {}

10.times do |i|
@model.put("#{i}", 'value')
attrs["#{i}"] = ['value']
end

@model.save!

load_model

@model.put('1', 'replaced_value')
@model.put('2', 'value2', {:replace => false})
attrs['1'] = ['replaced_value']
attrs['2'].push('value2')
@model.save!

load_model
@model.attributes.delete('updated-at')
@model.attributes.should == attrs
end