ryanb/cancan — Issue #553: accessible_by and Mongoid
Author: acuitycv
Created: 2012-01-26 20:10:07+00:00
State: open

Hi Ryan,

Mongoid uses field _id as the primary key. When I call accessible_by, it seems to return @selector with hash of id (as opposed to _id). I thought then, if I map id to _id with

field :id, :as => :_id

in the Model, it should work. But it does not, even though things like @cities = City.all(conditions: {:id => "toronto"}) (as opposed to _id) now work.

Please, advise.

Regards,
Serge