This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-12-26 06:38:42 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DomainNormalizable
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
before_validation :normalize_domain
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def normalize_domain
|
2019-02-03 03:59:51 +01:00
|
|
|
self.domain = TagManager.instance.normalize_domain(domain&.strip)
|
2018-12-26 06:38:42 +01:00
|
|
|
end
|
|
|
|
end
|