integrity/integrity — Issue #147: lib/integrity/checkout.rb
Author: khoan
Created: 2012-01-02 04:57:50+00:00
State: open

setup

```
git version 1.7.0.4
integrity v23
```

I was getting error below when building

```sh
NoMethodError: undefined method `each' for nil:NilClass

/usr/local/rvm/gems/ruby-1.9.3-p0/gems/dm-core-1.0.2/lib/dm-core/resource.rb:341:in `attributes='
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/dm-core-1.0.2/lib/dm-core/resource.rb:390:in `update'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/dm-validations-1.0.2/lib/dm-validations.rb:104:in `block in update'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/dm-validations-1.0.2/lib/dm-validations/support/context.rb:30:in `validation_context'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/dm-validations-1.0.2/lib/dm-validations.rb:104:in `update'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/builder.rb:39:in `start'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/builder.rb:15:in `build'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/builder.rb:4:in `build'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/build.rb:40:in `run!'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/threaded_builder.rb:14:in `block in enqueue'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/threaded_builder.rb:127:in `call'
/home/ubuntu/integrity-integrity-3adfe52/lib/integrity/threaded_builder.rb:127:in `block in spawn'
```

I had to do a quick patch below to get it going.

```ruby

# lib/integrity/checkout.rb

def metadata
...
unless dump["committed_at"].kind_of? Time
dump.update("committed_at" => Time.parse(dump["committed_at"]))
end

dump # <---- I added this line to return a value
end
```