Class: Eaternet::Lives_1_0::ValidatedObject::TypeValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/eaternet/lives_1_0.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object


61
62
63
64
# File 'lib/eaternet/lives_1_0.rb', line 61

def validate_each(record, attribute, value)
  record.errors.add attribute, (options[:message] || "is not of class #{options[:with]}") unless
    value.class == options[:with]
end