aq1018/mongoid-history — pull request #40 by foohey (2012-08-03 14:21:40+00:00)
Title: Mongoid 3 support & some 1.9.3 syntax

Some spec don't pass:

```console
Failures:

1) Mongoid::History track embedded with cascading callbacks should allow an update through the parent model
Failure/Error: @post.update_attributes(update_hash["post"])
NoMethodError:
undefined method `each' for 2012-08-03 13:50:51 UTC:Time
# ./spec/integration/integration_spec.rb:382:in `block (4 levels) in '

2) Mongoid::History track non-embedded should undo destruction
Failure/Error: Post.find(@post.id).title.should == "Test"
Mongoid::Errors::DocumentNotFound:

Problem:
Document(s) not found for class Post with id(s) 501bd73b3a6f66e81000015e.
Summary:
When calling Post.find with an id or array of ids, each parameter must match a document in the database or this error will be raised. The search was for the id(s): 501bd73b3a6f66e81000015e ... (1 total) and the following ids were not found: 501bd73b3a6f66e81000015e.
Resolution:
Search for an id that is in the database or set the Mongoid.raise_not_found_error configuration option to false, which will cause a nil to be returned instead of raising this error when searching for a single id, or only the matched documents when searching for multiples.
# ./spec/integration/integration_spec.rb:421:in `block (4 levels) in '

3) Mongoid::History track non-embedded should be destroyed after undo and redo
Failure/Error: @track.redo!(@user)
NoMethodError:
undefined method `destroy' for nil:NilClass
# ./lib/mongoid/history/tracker.rb:93:in `re_destroy'
# ./lib/mongoid/history/tracker.rb:40:in `redo!'
# ./spec/integration/integration_spec.rb:452:in `block (4 levels) in '
```
I was unable to find the problem, any help would be appreciated

But basically undo/redo an updated model seems to work in my app (mongoid3, rails 3.2.7...)

Otherwise, mongoid 3 now support only MRI 1.9.3 so I moved some things in 1.9.3 syntax (not the specs yet) in "mongoid3" branch