lib/assimilate/batch.rb in assimilate-0.0.5 vs lib/assimilate/batch.rb in assimilate-0.1.0
- old
+ new
@@ -130,23 +130,26 @@
@catalog.catalog.insert(decorate(slice))
end
end
def apply_updates
+ marker = @catalog.config[:update_marker]
@changes.each do |key, diffs|
@catalog.catalog.update(
{
@domainkey => domain,
idfield => key
},
- {"$set" => diffs}
+ {"$set" => diffs.merge(marker => datestamp)}
)
end
end
def decorate(records)
+ marker = @catalog.config[:insertion_marker]
records.map do |r|
r[@domainkey] = @domain
+ r[marker] = datestamp
r.to_hash
end
end
end