Module: Turl::Normalizer
Instance Method Summary collapse
Instance Method Details
#normalize(url) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/turl/normalizer.rb', line 5 def normalize(url) path = [] normalize_internal(url, path: path).tap do |result| path.each do |before| record = UrlNormalization.find_or_initialize_by(original_url: before) record.update!(normalized_url: result) end end end |