闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
265 B

  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