Commits

Sean Cribbs committed ebef99c

Make sure we run validations on all associated documents.

Comments (0)

Files changed (1)

ripple/lib/ripple/validations/associated_validator.rb

   module Validations
     class AssociatedValidator < ActiveModel::EachValidator
       def validate_each(record, attribute, value)
-        unless Array(value).all? {|r| r.nil? || r.valid? }
+        unless Array(value).map {|r| r.nil? || r.valid? }.all?
           record.errors.add(attribute, :invalid, :default => options[:message], :value => value)
         end
       end