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.

This project is archived and is in readonly mode.

removing unnecessary code in LengthValidator

#5297

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)

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

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: none

Activity

  1. Subba
    Subba
    • Assigned user changed from Santiago Pastorino to José Valim

    August 4th, 2010 @ 08:20 PM

  2. Repository