This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2018-12-25 21:38:42 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DomainNormalizable
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
2019-08-08 14:04:19 -07:00
|
|
|
before_save :normalize_domain
|
2018-12-25 21:38:42 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def normalize_domain
|
2019-02-02 18:59:51 -08:00
|
|
|
self.domain = TagManager.instance.normalize_domain(domain&.strip)
|
2018-12-25 21:38:42 -08:00
|
|
|
end
|
|
|
|
end
|