I have this really weird behaviour in my rails application. All find queries are run double.
I’ve verified this by logging the queries both on the ap side and on the DB side.
I’ve only tested it in development mode though.
I’ve added logging to the methods to see if the methods are called multiple times, but that wasn’t the case.
All saves run exactly once, so there are no problems there. Only the problem that page loads will be increasingly slower the more data there is in the DB since it queries all data twice.
I don’t even know which parts of the code I should paste, since I have no clue where this could be coming from.
I’m using mongoid (3.0.13), rails (3.1.3)
Here’s the link to github for the whole source https://github.com/deiga/new-Roydon/tree/develop
You’ve probably resolved it by now, but I had the same issue and the reason was the
bulletgem, which reruns every Mongoid find for the purpose of measuring the performance.I can see that you also have it included in your Gemfile, so that’s probably it.