artsy/garner — pull request #27 by macreery (2013-05-22 01:47:29+00:00)
Title: Properly invalidate all_embedding_documents on creation of an embedded document

cc: @mzikherman

Before, we would've had this undesirable behavior:

```ruby
class Superfoo
include Mongoid::Document
embeds_many :foos
end

class Foo
include Mongoid::Document
embedded_in :superfoo
end

def find_cached_superfoo(id)
Garner::Cache::ObjectIdentity.cache({ bind: [Superfoo, { id: id }] }) do
Superfoo.find(id)
end
end

superfoo = Superfoo.create!
puts find_cached_superfoo(superfoo.id).foos
# >> []

superfoo.foos.create!
puts superfoo.foos
# >> [#]
puts find_cached_superfoo(superfoo.id).foos
# >> []
```