lib/updateagent/updateagent.rb in onebody-updateagent-0.5.4 vs lib/updateagent/updateagent.rb in onebody-updateagent-0.6.0
- old
+ new
@@ -233,10 +233,10 @@
print "#{resource.name} 0/#{ids.length}\r"; STDOUT.flush
ids.each_slice(MAX_HASHES_AT_A_TIME) do |some_ids|
options = {:attrs => @attributes.join(','), :legacy_id => some_ids.join(',')}
options.merge!(:debug => true) if @options['debug']
response = resource.post(:hashify, {}, options.to_xml)
- hashes = Hash.from_xml(response.body)['records'].to_a
+ hashes = Array(Hash.from_xml(response.body)['objects'])
hashes.each do |record|
row = data_by_id[record['legacy_id'].to_i]
if @options['debug']
row['remote_hash'] = record['hash']
@update << row if force or row.values_for_hash(@attributes).join != record['hash'] or (resource.name == 'Person' and record['family_id'].nil?)