lib/mongoid/validatable/macros.rb in mongoid-6.1.0 vs lib/mongoid/validatable/macros.rb in mongoid-6.1.1
- old
+ new
@@ -15,11 +15,12 @@
# embeds_many :addresses
#
# validates_associated :name, :addresses
# end
#
- # @param [ Array ] *args The arguments to pass to the validator.
+ # @param [ Array ] args The arguments to pass to the validator.
+ #
def validates_associated(*args)
validates_with(AssociatedValidator, _merge_attributes(args))
end
# Validates whether or not a field is unique against the documents in the
@@ -32,10 +33,11 @@
# field :title
#
# validates_uniqueness_of :title
# end
#
- # @param [ Array ] *args The arguments to pass to the validator.
+ # @param [ Array ] args The arguments to pass to the validator.
+ #
def validates_uniqueness_of(*args)
validates_with(UniquenessValidator, _merge_attributes(args))
end
# Validates the format of a field.