mongoid-tags-arent-hard
mongoid-tags-arent-hard copied to clipboard
Mongoid4 Compatibility
This is the beginning of a Mongoid 4 compatible version of this gem.
I've set up Travis-CI to run the test suite against multiple Mongoid versions and Rubies, defaulting to Mongoid ~>3.1
This is not ready to merge yet. I'm using this PR as a base for discussion.
The only failing test is that adding to the tags using <<
does not correctly reflect changes in the document:
foo.send("tags=", [])
foo.send("tags") << ["foo", "bar"]
foo.changed => ["tags"]
foo.changed? => false
foo.changes => {}
I'm kind of out of ideas now, it's my first time playing with Mongoid internals and I'm not sure if this is a problem with the Mongoid gem itself, or with this one.
Hmm.... not really sure I know the answer. I don't use Mongo, or this gem anymore. I wrote it for a client I had a year ago. I'm sure it's probably something pretty obvious, but I don't really have the mind share to devote to this right now. Sorry. I'm sure you'll nail it given a bit of time. Plus, you'll learn a lot more about how Mongoid works!
Thanks.