Lets say I have a Collection of users. Is there a way of using mongoid to find n random users in the collection where it does not return the same user twice? For now lets say
Since I want to keep a criteria, I do:
scope :random, ->{ random_field_for_ordering = fields.keys.sample random_direction_to_order = %w(asc desc).sample order_by([[random_field_for_ordering, random_direction_to_order]]) }