I want to limit the number of associated objects in a has_many association between a post and pictures :
In active record i can do something like
class post < < ActiveRecord::Base
has_many :pictures, :limit => 2
end
But mongoid raise an exception with limit:
Invalid option :limit provided to relation :pictures. Valid options are: as, autosave, dependent, foreign_key, order, class_name, extend, inverse_class_name, inverse_of, name, relation, validate. (Mongoid::Errors::InvalidOptions)
Is there an alternative implementation to relize :limit?