Sha256: c753cc8b883c301abae74e9e1bd7d991b5cb4b920b39c07ada12f5a100bc934d
Contents?: true
Size: 428 Bytes
Versions: 13
Compression:
Stored size: 428 Bytes
Contents
# Uses the Phony.plausible method to validate an attribute. # Usage: # validate :phone_number, :phony_plausible => true class PhonyPlausibleValidator < ActiveModel::EachValidator # Validates a String using Phony.plausible? method. def validate_each(record, attribute, value) return if value.blank? record.errors[attribute] << (options[:message] || "is an invalid number") if not Phony.plausible?(value) end end
Version data entries
13 entries across 13 versions & 1 rubygems