datamapper/dm-core — Issue #157: Calling #reload on a resource deleted in another process should mark the resource destroyed
Author: d11wtq
Created: 2011-10-19 16:57:47+00:00
State: open

I'll have a look at this later, but to me, it seems logical that the following behaviour should not exhibit:

In process A:

``` ruby
@resource = Model.get!(1)
@resource.destroy
```

In process B, simultaneously (or in the same process without the identity map):

``` ruby
@resource = Model.get!(1)

# process A deletes the resource around about here

p @resource.reload.destroyed? #=> false
```

To me, since we have a persisted state the indicated the resource is saved, yet we've failed to find the resource when doing a reload (note no exception is thrown), the resource should be flagged as destroyed.

This crops up in rails specs trying to assert that a record has been destroyed by a controller (in a semantic way).