#1419 ✓resolved
David R. MacIver

ValidationErrors lies in respond_to?

Reported by David R. MacIver | September 28th, 2010 @ 07:30 AM | in 1.1

It's delegating to the errors object in method missing. Unfortunately this means that respond_to returns wildly inaccurate results. I found this because we have specs of the form should have(1).errors, which tests if the errors object responds to length or size, concludes it doesn't and thus it's not a collection object.

You probably want something like the following code in there:

def respond_to?(method)
  super || errors.respond_to?(method)
end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Referenced by

Pages