class ActiveRecord::Validations::AssociatedBubblingValidator
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/validates_associated_bubbling/initializer.rb, line 7 def validate_each(record, attribute, value) Array(value).reject(&:valid?).each do |v| v.errors.full_messages.each do |msg| record.errors.add attribute, msg, options.merge(value: value) end end end