I managed to resolve this. I still have no idea how or why the above could have happened (surely m = Model.find(id); (id == m.id)
should always be true!), though I still suspect the cache, as it seemed to only happen if the cache was primed.
I did the following, I believe something in these steps resolved the issue:
- pruned my
Gemfile
removing some unused gems like dalli, and removing the version constraint all but a few cases to allow updating. - run
bundle update
resulting in a lot of updated dependancies - I'm was used a custom buildpack on Heroku (forked from the official ruby one), I pulled in the last few months of upstream changes.
Thanks to everyone who read & commented. I guess something was just amiss in my gem dependancies or heroku environment.