ValidationErrors#on: allow String field_name

This commit is contained in:
Geoff Buesing 2009-03-24 17:37:52 -05:00 committed by Matt Aimonetti
parent 49d19e2a29
commit 125689cd34
2 changed files with 7 additions and 1 deletions

View file

@ -89,7 +89,7 @@ module CouchRest
#
# @param <Symbol> field_name the name of the field you want an error for
def on(field_name)
errors_for_field = errors[field_name]
errors_for_field = errors[field_name.to_sym]
errors_for_field.blank? ? nil : errors_for_field
end