diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index eac3c8285a7b9cbfe9873ea92db139369f64e8ab..95edecc5134a3d398f39a27749fcb539805100d8 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -37,7 +37,11 @@ class Communication::Website < ApplicationRecord end def domain_url - "https://#{ domain }" + "https://#{domain}" + end + + def uploads_url + "#{domain_url}/wp-content/uploads" end def import! diff --git a/app/models/communication/website/imported/with_rich_text.rb b/app/models/communication/website/imported/with_rich_text.rb index b74264692ceebcde3f3be39cf3a1255aa45d98d5..a1ac94cdaca424f38ac642a8ab04cc07fffff8bc 100644 --- a/app/models/communication/website/imported/with_rich_text.rb +++ b/app/models/communication/website/imported/with_rich_text.rb @@ -5,7 +5,7 @@ module Communication::Website::Imported::WithRichText def rich_text_with_attachments(text) fragment = Nokogiri::HTML.fragment(text) - images = fragment.css("img[src*=\"#{website.website.domain_url}\"]") + images = fragment.css("img[src*=\"#{website.website.uploads_url}\"]") images.each do |image| begin url = image.attr('src')