domain_normalizable.rb 265 B

123456789101112131415
  1. # frozen_string_literal: true
  2. module DomainNormalizable
  3. extend ActiveSupport::Concern
  4. included do
  5. before_validation :normalize_domain
  6. end
  7. private
  8. def normalize_domain
  9. self.domain = TagManager.instance.normalize_domain(domain&.strip)
  10. end
  11. end