Methods
Instance Public methods
validate_each(record, attribute, value) Link
Source: show
# File app/validators/not_protected_page_validator.rb, line 2 def validate_each(record, attribute, value) return if record.site.blank? value = value.start_with?("http") ? value : "http://#{value}" uri = URI.parse(value) if is_protected?(record, uri.path) record.errors.add(attribute, "must not be a protected page") end end