Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/dm-validations/validation_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down