Skip to content
Snippets Groups Projects
Commit 5646e11e authored by Arnaud Levy's avatar Arnaud Levy
Browse files

no screenshot without url

parent 97b2104a
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,10 @@ module Communication::Website::WithScreenshot
end
def screenshot!
return if url.blank?
screenshot_url = Screenshot.capture(url)
downloaded_image = URI.open(screenshot_url)
self.screenshot.attach(io: downloaded_image , filename: "screenshot.png")
self.screenshot.attach io: downloaded_image,
filename: "screenshot.png"
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment