Status
I have to download an image from a 3rd-party URL and attach the downloaded file (a picture in my case) as an attachment to a local object. Thus I created a PictureLoader
class and written a class method in this class.
I am doing the following:
picture = URI.open(image_url)
object.the_downloaded_picture.attach(io: picture, filename: object.id.to_s+"_picture.jpg", content_type: 'image/jpeg')
The local server console (=> rails s
) fails with
ArgumentError (A copy of PictureLoader has been removed from the module tree but is still active!)
GOAL: I am simply trying to download an image an attach it but I dont know how to solve this.