Sha256: b6e92de54353d8cefda8d987113658a93f4a3b169693928c7ba792a9b52a37ed
Contents?: true
Size: 612 Bytes
Versions: 12
Compression:
Stored size: 612 Bytes
Contents
module Mongoid module Validations module Macros extend ActiveSupport::Concern # Validates the size of a collection. # # @example # class Person # include Mongoid::Document # has_many :addresses # # validates_collection_size_of :addresses, minimum: 1 # end # # @param [ Array ] args The names of the fields to validate. # # @since 2.4.0 def validates_collection_size_of(*args) validates_with(Mongoid::Validations::CollectionSizeValidator, _merge_attributes(args)) end end end end
Version data entries
12 entries across 12 versions & 2 rubygems