FEATURE: add flair to avatars using new settings in the groups admin UI

This commit is contained in:
Neil Lalonde
2016-08-16 12:34:04 -04:00
parent 72d7c055f4
commit d079f69b7b
18 changed files with 195 additions and 9 deletions

View File

@ -0,0 +1,11 @@
class UrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if value.present?
uri = URI.parse(value) rescue nil
unless uri
record.errors[attribute] << (options[:message] || I18n.t('errors.messages.invalid'))
end
end
end
end