You’re not missing anything – MM does not have a capability for detecting changes on objects modified in place like that. It can only detect changes when the key is assigned using doc.key = “whatever”
s.remote_ip << “.1” wouldn’t work either.
Getting MM to track changes made in place to object keys is a pretty big job. I’ve tried (see mm-dirtier on github) but it’s still very much a work in progress. There are still a number of edge cases that simply don’t work. I would think that for the moment your best bet might be doing a diff of the attributes hash before you save. I don’t know what kind of performance implication that would have, but given the difficulty of the alternative, I may have to switch my projects to an approach like that ultimately as well.
Nathan
--
You received this message because you are subscribed to the Google
Groups "MongoMapper" group.
For more options, visit this group at
http://groups.google.com/group/mongomapper?hl=en?hl=en