Fixed syntax to be compatiable with latest mongoid