Sha256: b48ee1e6de162fa7bb97c6f849b7056734bc4982c027eb9bbcbfc647015b6c13
Contents?: true
Size: 439 Bytes
Versions: 35
Compression:
Stored size: 439 Bytes
Contents
module MongoDoc module Validations module ValidatesEmbedded def validates_embedded(*attr_names) validates_with EmbeddedValidator, _merge_attributes(attr_names) end class EmbeddedValidator < ::ActiveModel::EachValidator def validate(record) attributes.each do |attr| record.errors.add(attr) unless record.send(attr).valid? end end end end end end
Version data entries
35 entries across 35 versions & 2 rubygems