datamapper/dm-types — pull request #71 by blt04 (2014-05-22 02:09:21+00:00)
Title: DirtyMinder should not extend NilClass

Can PR #50 be back ported to the `release-1.2` branch? When using DataMapper with Passenger, Passenger sometimes freezes the `nil` value (see https://code.google.com/p/phusion-passenger/issues/detail?id=1093). When `DirtyMinder` tries to track a frozen nil value, an error can occur:

```
/Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-types-1.2.2/lib/dm-types/support/dirty_minder.rb:144:in `track': can't modify frozen object (RuntimeError)
from /Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-types-1.2.2/lib/dm-types/support/dirty_minder.rb:161:in `hook_value'
from /Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-types-1.2.2/lib/dm-types/support/dirty_minder.rb:151:in `set!'
from /Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-core-1.2.1/lib/dm-core/property.rb:625:in `set'
from /Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-core-1.2.1/lib/dm-core/resource/persistence_state.rb:22:in `set'
from /Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-core-1.2.1/lib/dm-core/resource/persistence_state/transient.rb:14:in `set'
from /Users/bturner/.rvm/gems/ruby-2.1.2@ghnproxy/gems/dm-core-1.2.1/lib/dm-core/model/property.rb:238:in `headers='
from test.rb:19:in `

'
```

PR #50 limited extending classes with `Hooker` to only certain classes. It would be awesome to back port this fix into 1.2.x.

This PR simply cherry-picks mbj's fixes to `release-1.2`.