Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Rails 3: errors[:key_without_errors] returns empty array

#6755

There is no reason for this to return an array instead of nil. Makes testing for errors on the object non-intuitive.

With rails 2 in Rspec I can write:

obj.errors.on(:key_without_errors).should be_nil

With rails 3 in Rspec I have to write the weird notation of:

obj.errors[:key_without_errors].to_a.should be_nil

Can we just return nil instead of an empty array?

Reported by weexpectedthis · April 28th, 2011 @ 11:39 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

No comments yet.