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
161
162
163
|
# File 'app/validators/slug_validator.rb', line 161
def applicable?
true
end
|
#validate! ⇒ Object
165
166
167
|
# File 'app/validators/slug_validator.rb', line 165
def validate!
record.errors[attribute] << "must be usable in a url" unless valid_slug?(value)
end
|