Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into feature/removing_ruby_junk
This commit is contained in:
15
app/models/concerns/link_normalizable.rb
Normal file
15
app/models/concerns/link_normalizable.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user