module ActiveModel::Validations::HelperMethods
Public Instance Methods
validates_plausible_phone(*attr_names)
click to toggle source
# File lib/validators/phony_validator.rb, line 63 def validates_plausible_phone(*attr_names) # merged attributes are modified somewhere, so we are cloning them for each validator merged_attributes = _merge_attributes(attr_names) validates_with PresenceValidator, merged_attributes.dup if merged_attributes[:presence] validates_with FormatValidator, merged_attributes.dup if merged_attributes[:with] || merged_attributes[:without] validates_with PhonyPlausibleValidator, merged_attributes.dup end