Method: Sequel::Model::Errors#on

Defined in:
lib/sequel/model/errors.rb

#on(att) ⇒ Object

Returns the array of errors for the given attribute, or nil if there are no errors for the attribute.

errors.on(:name) # => ['name is not valid']
errors.on(:id) # => nil


51
52
53
54
55
# File 'lib/sequel/model/errors.rb', line 51

def on(att)
  if v = fetch(att, nil) and !v.empty?
    v
  end
end