markbates / mongoid-tags-arent-hard

A tagging gem for Mongoid 3 that doesn't actually suck.
MIT License
16 stars 12 forks source link

Mongoid4 Compatibility #14

Open shaneog opened 10 years ago

shaneog commented 10 years ago

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.

markbates commented 10 years ago

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.