Reputation: 4367
I have a simple query:
Store.where( params[:conditions] || {}).all
In logs ,it appears that mongo mapper is firing the same query twice.
2013-07-28 14:01:05 - [DEBUG]: MONGODB (0.7ms) db-development['stores'].find().
2013-07-28 14:01:05 - [DEBUG]: MONGODB (0.5ms) db-development['stores'].find().
This seems like a bug to me. See also https://github.com/jnunemaker/mongomapper/pull/467.
Apparently, this bug still not fixed..
Does Anybody know how can I write the query with a single access to database?
UPDATE:
At gem list
:
mongo_mapper (0.12.0)
plucky (0.5.2)
Thanks!!
Upvotes: 0
Views: 150
Reputation: 62638
This is a known bug with Plucky 0.5.2. Try upgrading to MM 0.13.0.beta1, or using MM's master.
Upvotes: 1