Sha256: bb274fc9b760a257f0a98b4bbaae0e36074c5171a13641ffe08255458836b9ce

Contents?: true

Size: 276 Bytes

Versions: 38

Compression:

Stored size: 276 Bytes

Contents

module Validatable
  class ValidatesAssociated < ValidationBase #:nodoc:
    def valid?(instance)
      Array(instance.send(attribute)).compact.map do |child|
        child.valid?
      end.all?
    end

    def message(instance)
      super || "is invalid"
    end
  end
end

Version data entries

38 entries across 38 versions & 9 rubygems

Version Path
hashrocket-validatable-1.7.4 lib/validations/validates_associated.rb
lgustafson-validatable-1.8.7 lib/validatable/validations/validates_associated.rb
lgustafson-validatable-1.8.6 lib/validatable/validations/validates_associated.rb
np422-validatable-1.8.5 lib/validatable/validations/validates_associated.rb
validatable2-0.0.14 lib/validatable/validations/validates_associated.rb
validatable2-0.0.13 lib/validatable/validations/validates_associated.rb
validatable2-0.0.12 lib/validatable/validations/validates_associated.rb
validatable2-0.0.11 lib/validatable/validations/validates_associated.rb
validatable2-0.0.10 lib/validatable/validations/validates_associated.rb
validatable2-0.0.9 lib/validatable/validations/validates_associated.rb
validatable2-0.0.8 lib/validatable/validations/validates_associated.rb
validatable2-0.0.7 lib/validatable/validations/validates_associated.rb
validatable2-0.0.6 lib/validatable/validations/validates_associated.rb
validatable2-0.0.5 lib/validatable/validations/validates_associated.rb
validatable2-0.0.4 lib/validatable/validations/validates_associated.rb
validatable2-0.0.3 lib/validatable/validations/validates_associated.rb
validatable2-0.0.2 lib/validatable/validations/validates_associated.rb
validatable2-0.0.1 lib/validatable/validations/validates_associated.rb
erotte-validatable-1.8.5 lib/validatable/validations/validates_associated.rb
mongomatic-0.0.2 lib/validatable/validations/validates_associated.rb