Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

on method should return empty array if there are no errors #41

Open
wants to merge 1 commit into from

2 participants

@BinaryPaean

Make on method actually return empty array in case of no errors, instead of nil. Method now matches documentation.

@largon

+1

Is there a reason for returning nil? (And therefore not accepting this pull request?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 8, 2011
  1. @BinaryPaean

    Make on method actually return empty array in case of no errors, inst…

    BinaryPaean authored
    …ead of nil. Method now matches documentation.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/dm-validations/validation_errors.rb
View
2  lib/dm-validations/validation_errors.rb
@@ -99,7 +99,7 @@ def full_messages
# on given field
def on(field_name)
errors_for_field = errors[field_name]
- DataMapper::Ext.blank?(errors_for_field) ? nil : errors_for_field.uniq
+ DataMapper::Ext.blank?(errors_for_field) ? [] : errors_for_field.uniq
end
def each
Something went wrong with that request. Please try again.