This project is archived and is in readonly mode.
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
-
Subba August 4th, 2010 @ 08:20 PM
- Assigned user changed from Santiago Pastorino to José Valim
-
Repository August 14th, 2010 @ 12:23 PM
- State changed from new to resolved
(from [b61ff257e9ae4b74d4fc3b0d7d24dd15f127de1c]) tidy up validations length code [#5297 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/b61ff257e9ae4b74d4fc3b0d7d24dd...
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>
People watching this ticket
Attachments
Referenced by
- 5297 removing unnecessary code in LengthValidator (from [b61ff257e9ae4b74d4fc3b0d7d24dd15f127de1c]) tidy up...