method
inclusion_method
v4.1.8 -
Show latest stable
- Class:
ActiveModel::Validations::Clusivity
inclusion_method(enumerable)private
In Ruby 1.9 Range#include? on non-number-or-time-ish ranges checks all possible values in the range for equality, which is slower but more accurate. Range#cover? uses the previous logic of comparing a value with the range endpoints, which is fast but is only accurate on Numeric, Time, or DateTime ranges.