gab-social/app/models/concerns/link_normalizable.rb
mgabdev c18991f174 Added LinkBlock functionality in admin
• Added:
- LinkBlock functionality in admin
2020-12-08 23:19:10 -05:00

16 lines
253 B
Ruby

# frozen_string_literal: true
module LinkNormalizable
extend ActiveSupport::Concern
included do
before_validation :normalize_link
end
private
def normalize_link
self.link = TagManager.instance.normalize_link(link&.strip)
end
end