Sha256: 96856f6cf9517fb3212638791032f56c30d01b2abee0822a7f7d3dfa66e66619
Contents?: true
Size: 447 Bytes
Versions: 6
Compression:
Stored size: 447 Bytes
Contents
module CouchRest module Model module Validations class CastedModelValidator < ActiveModel::EachValidator def validate_each(document, attribute, value) values = value.is_a?(Array) ? value : [value] return if values.collect {|doc| doc.nil? || doc.valid? }.all? document.errors.add(attribute, :invalid, :default => options[:message], :value => value) end end end end end
Version data entries
6 entries across 6 versions & 3 rubygems