2018-12-26 16:38:42 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DomainNormalizable
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
2019-08-09 07:04:19 +10:00
|
|
|
before_save :normalize_domain
|
2018-12-26 16:38:42 +11:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def normalize_domain
|
2019-02-03 13:59:51 +11:00
|
|
|
self.domain = TagManager.instance.normalize_domain(domain&.strip)
|
2018-12-26 16:38:42 +11:00
|
|
|
end
|
|
|
|
end
|