From mongoid 3.1.x to mongoid 4.0.0 the behavior of 'only' method has changed
You cannot access the id without explicit passing it as a parameter to 'only' method, changed to always have id as an attribute

fixes #3525
Merge pull request #3533 from rodrigosaito/include_id_in_only

Change in behavior with MongoDB projections and Mongoid 'only' method.