rs-pro / mongoid-elasticsearch

DEPRECATED - Consider using SearchKick https://github.com/ankane/searchkick
MIT License
61 stars 23 forks source link

Properly restore BSON::ObjectId from ES document using :model wrapper. #2

Closed Antti closed 10 years ago

Antti commented 10 years ago

When you use :model wrapper, and it loads object attributes from ES to Mongoid model, it sets your association's id as {"$oid" => BSON::ObjectId()}, where it should just be BSON::ObjectId().

Some related info https://github.com/mongoid/mongoid/pull/2947

https://github.com/rs-pro/mongoid-elasticsearch/issues/1

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.02%) when pulling feeb3733b030be39cbea0ebafc758ca3eafaf34a on Antti:fix_relation_id_loading_with_model_wrapper into 7dab1568d3c87406a1dc80e33dd403696ee541dc on rs-pro:master.

glebtv commented 10 years ago

Thank you!