lib/validators/phony_validator.rb in phony_rails-0.0.4 vs lib/validators/phony_validator.rb in phony_rails-0.0.5
- old
+ new
@@ -1,8 +1,8 @@
# Uses the Phony.plausible method to validate an attribute.
# Usage:
-# validate :phone_number, :phony => true
-class PhonyValidator < ActiveModel::EachValidator
+# 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)
\ No newline at end of file