Class: SteelWheel::Query::VerifyValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/steel_wheel/query/verify_validator.rb

Overview

Verify validation for objects

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



7
8
9
10
11
# File 'lib/steel_wheel/query/verify_validator.rb', line 7

def validate_each(record, attribute, value)
  return if value.nil? || value.valid?

  value.errors.each { |error| add_error_to_record(record, attribute, error) }
end