Sha256: ceadd1d84f07579aaffc1256b091fa9388402c0802d9db7e6b6f6e8c1c7bb67a

Contents?: true

Size: 405 Bytes

Versions: 8

Compression:

Stored size: 405 Bytes

Contents

module Shamu
  module Attributes
    module Validators
      # Validates that an attribute's value returns true for `valid?`.
      #
      # validates :nested_request, valid: true
      class ValidValidator < ActiveModel::EachValidator
        def validate_each( record, attribute, value )
          record.errors.add attribute, :invalid if value && !value.valid?
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shamu-0.0.24 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.21 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.20 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.19 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.18 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.17 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.15 lib/shamu/attributes/validators/valid_validator.rb
shamu-0.0.14 lib/shamu/attributes/validators/valid_validator.rb