thetron / mongoid-enum

Sweet enum sugar for your Mongoid documents
MIT License
117 stars 166 forks source link

Change in criteria prefixing #32

Open p3drosola opened 8 years ago

p3drosola commented 8 years ago

I've just updated to mongoid5 and mongoid-enum 0.4, and noticed a change in how criteria is built.

In emongoid-enum 0.2 Model.where(enum_name: :value) would translate to the mongo query for {_enum_name: "value"} that is, it added the field prefix to the query. That doesn't seem to be working anymore.

Is this the expected behaviour?

p3drosola commented 8 years ago

I also noticed that enum_changed? is now _enum_changed? is this on purpose or a regression?