This project is archived and is in readonly mode.

#5297 ✓resolved
Subba

removing unnecessary code in LengthValidator

Reported by Subba | August 4th, 2010 @ 04:13 PM

this patch refactors LengthValidator code in activemodel

valid_value = if key == :maximum
 value.nil? || value.size.send(validity_check, check_value)
else
 value && value.size.send(validity_check, check_value)
end
 
next if valid_value

to much simpler

value ||= [] if key == :maximum
next if value && value.size.send(validity_check, check_value)

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages