lib/heliodor/query_internal.rb in heliodor-0.1.0 vs lib/heliodor/query_internal.rb in heliodor-0.1.1

- old
+ new

@@ -48,14 +48,28 @@ @full.delete(@table) @table = to @dat = @full[@table] end - def _delete - @full.delete @table - @db.write(@full) - @dat = nil + def _delete(dat) + d = @dat + @dat = d.map do |i| + if dat.class == Hash + if i >= dat + nil + else + i + end + else + if i == dat + nil + else + i + end + end + end + @dat end def _write @full[@table] = @dat @db.write(@full) @@ -81,10 +95,10 @@ when 'insert' _insert(action['data']) when 'rename' _rename(action['to']) when 'delete' - _delete + _delete(actopm['dat']) when 'write' _write else raise NotImplementedError, "Action `#{action['type']}` is not yet implemented!"