Class: SlugValidator::DefaultValidator
Instance Method Summary
collapse
#ends_with?, #of_kind?, #starts_with?, #url_after_first_slash, #url_after_first_slash_is_valid_slug!, #url_parts, #valid_slug?
Instance Method Details
#applicable? ⇒ Boolean
126
127
128
|
# File 'app/validators/slug_validator.rb', line 126
def applicable?
true
end
|
#validate! ⇒ Object
130
131
132
|
# File 'app/validators/slug_validator.rb', line 130
def validate!
record.errors[attribute] << "must be usable in a url" unless valid_slug?(value)
end
|